Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Find the files based on date from filelist Post 303039258 by kumarinfa on Friday 27th of September 2019 09:58:27 AM
Old 09-27-2019
As i couldnt find the approach to get the file based on date directly from FTP server, i will get all the file names on my local and create filelist and then extract the file names greater than the particular date,

Code:
Date="20190926"
Filelist=FTP_DTL.txt

awk -v cutoff="$(date -d "$Date" +%s)" '{line=$0; "date -d \""$6" " $7" " $8 "\" +%s" |getline; fdate=$1} fdate > cutoff {print line} ' FTP_DTL.txt | awk -F ' ' '{print $9}' > Latest_File.txt

Above command will give me file names which are greater or equal to the date variable, and store in Latest_File.txt. Then will run the for loop on the Latest_File.txt and get those relevant files from FTP server. I cannot think of anything and not sure about the performance about this. Kindly share the views on this, or any other approach.

Thank You
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help on cat filelist.txt |xargs -n1 find

I am trying to find all the files listed in a filelist.txt. Why cant I use something like this cat filelist.txt | xargs -n1 find $path (2 Replies)
Discussion started by: dragonpoint
2 Replies

2. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

Hi All, I am new to shell srcipting. Problem : I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

3. Shell Programming and Scripting

move files defined in filelist

Hi, I have a filelist named filestomove.txt. It can contain any number of files that need to be moved to a subdirectory. All the files from filelist are in the same directory as the filelist, let say it's called Folder1. All the files need to be moved to subfolder Folder1/Subfolder1. ... (1 Reply)
Discussion started by: kedrick
1 Replies

4. Shell Programming and Scripting

Find and count unique date values in a file based on position

Hello, I need some sort of way to extract every date contained in a file, and count how many of those dates there are. Here are the specifics: The date format I'm looking for is mm/dd/yyyy I only need to look after line 45 in the file (that's where the data begins) The columns of... (2 Replies)
Discussion started by: ronan1219
2 Replies

5. Shell Programming and Scripting

Find the latest file based on the date in the filename

Hi, We've a list of files that gets created on a weekly basis and it has got a date and time embedded to it. Below are the examples. I want to find out how to get the latest files get the date and time stamp out of it. Files are PQR123.PLL.M989898.201308012254.gpg... (1 Reply)
Discussion started by: rudoraj
1 Replies

6. UNIX for Dummies Questions & Answers

Looking for command line to find dirs based on size and date

Hi, My first time on this site, please excuse me if I've come to the wrong forum. I'm fairly new to Unix/Linux and hoping you can help me out. I'm looking for a command line that will return a list of directories that are larger than 50M and older than 2 days. I thought it may be... (6 Replies)
Discussion started by: Wisconsingal
6 Replies

7. UNIX for Dummies Questions & Answers

Unable to find files, those can be present anywhere in the directory tree,based on its creation date

Hi I am unable to find files, those are present anywhere in the same directory tree, based on the creation date. I need to find the files with their path, as I need to create them in another location and move them. I need some help with a script that may do the job. Please help (2 Replies)
Discussion started by: sam192837465
2 Replies

8. Shell Programming and Scripting

Find fields based on date criterion

Hi All , I am trying to find some non empty files from a directory based on below conditions : Files:: SIZE DATE FILE 3679 Jan 25 23:59 belk_rpo_error_po9324892_01252014.log 0 Jul 01 06:30 belk_rpo_error_po9324267_07012014.log 0 Jul 20 05:50... (7 Replies)
Discussion started by: LoneRanger
7 Replies

9. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

10. UNIX for Beginners Questions & Answers

Find and copy .zip file based on today's date

Hi Team, I'm new to unix and i have a requirement to copy or move files from one directory to another based on current date mentioned in the .zip file name. Note that i need to copy only the recent zip file. please help me with the code i tried the code as: #! /usr/bin/sh find... (3 Replies)
Discussion started by: midhun3108
3 Replies
BUILDTORRENT(1) 						   User Commands						   BUILDTORRENT(1)

NAME
buildtorrent - a torrent file creation program. SYNOPSIS
buildtorrent [OPTIONS] -a announceurl input output buildtorrent [OPTIONS] -a announceurl -f filelist -n name output DESCRIPTION
buildtorrent is a torrent file creation program. Given an announce url and an input file or directory, buildtorrent generates an output .torrent file that can be used by torrent clients. OPTIONS
-a announce, --announce=url Announce URL (required). -f filelist, --filelist=filelist A text file (or - for standard input) containing a list of files to add to the output torrent file, together with the path to use inside the torrent. One file is given per line, use / as path separator for the torrent path, use | to separate the filesystem path from the torrent path. Backslash can be used to escape newlines and | characters inside names. For example: /data/files/linux.iso|bin/linux.iso /data/files/linux.txt|doc/linux.txt Using this option requires that the --name option be used. -n name, --name=name Specify the name for the torrent. Usage of this option is required when the --filelist option is used, in which case it specifies the name of the torrent directory. Usage without a file list overrides the name of the directory or file given on the command line. -A announces, --announcelist=announces Additional announce URL list. Use , to separate outer level lists, and | to separate inner level items; for example: a,b1|b2,c -w webseeds, --webseeds=webseeds Additional WebSeed URL list. Use , to separate items; for example: a,b,c -l length, --piecelength=length Piece length in bytes (default 262144). -L length, --piecesize=size Use 2^size as piece length (default 18) (overrides -l ). -c comment, --comment=comment User comment (omitted by default). -p private, --private=private Private flag (either 0 or 1). -D, --nodate Omit the creation date field. -C, --nocreator Omit the created by field. -m, --md5sum Add an md5sum field for each file. -s, --show Show generated torrent structure. -S, --showall Show generated torrent structure, including piece data. -q, --quiet Quiet operation with reduced output. -V, --version Show the version string. -h, --help Show a help screen with brief usage information. AUTHORS
Claude Heiland-Allen (claudiusmaximus@goto10.org) SEE ALSO
createtorrent(1), mktorrent(1) http://wiki.theory.org/BitTorrentSpecification http://bittorrent.org/beps/bep_0012.html http://www.getright.com/seedtorrent.html 0.8 January 2010 BUILDTORRENT(1)
All times are GMT -4. The time now is 06:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy