Operating System - HP-UX
1830431 Members
2892 Online
110002 Solutions
New Discussion

Copy specific date range files to another server by ftp

 
syedar
Advisor

Copy specific date range files to another server by ftp

Hi all,

I need to copy specific date range files for example 24,25 and 26 Dec files to another server by ftp using find command.

4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Copy specific date range files to another server by ftp

Hi:

You can create to reference points (for the file age) and then use 'find' to select files within this date range. Pipe the output to your FTP script:

# touch -amt 200812240000.00 /tmp/f1
# touch -amt 200812262359.59 /tmp/f2
# find . -xdev -type f -newer tmp/f1 -a !-newer /tmp/f2 -print | myftpscript

See the 'touch' and 'find' manpages for more information.

Regards!

...JRF...
Suraj K Sankari
Honored Contributor

Re: Copy specific date range files to another server by ftp

Hi JFR,

I think in this method search will give the result the all file from the new file which I created through touch.

Here Syedar want to search only which files are created or modify on 24 or between 24 to 26.

Suraj
syedar
Advisor

Re: Copy specific date range files to another server by ftp

thanks JRF
OldSchool
Honored Contributor

Re: Copy specific date range files to another server by ftp

suraj....note the uses of "newer" and "!newer" in the command illustrated...as in "newer than 24th and not newer then 26th"...