![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Source and Target count checking | ksmbabu | Shell Programming and Scripting | 2 | 04-03-2008 04:57 AM |
| shell script to transfer files from Unix to Windows | knag | Shell Programming and Scripting | 15 | 12-05-2006 05:46 PM |
| Tar files, transfer to remote host and delelte source | Dago | SUN Solaris | 0 | 02-28-2006 05:35 PM |
| Transfer files from Unix server to Windows using FTP | gjsaravanan | UNIX for Dummies Questions & Answers | 1 | 08-22-2005 08:55 PM |
| vi, c/source/target g? | yls177 | UNIX for Dummies Questions & Answers | 7 | 12-02-2002 11:46 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Shell script to transfer the files from source to target server.
I need to write a shell script to transfer the files every hour from source - target server.
The cron job should be running every hour and shouldn't copy already copied files to the remote server ? I was able to write intial script but not able to get the logic for (in the next run it should copy only newly created files with in that hour) Here is the logic:- for I in `ls` do echo $I - Log from cron scp $I pluto@5.67.16.25:$REMOTE_LOC/ sleep 120 done Thanks, |
|
|||||
|
Maybe you can...
For the succeeding steps, why not use find instead of ls in filtering the files that needs to be copied, that way you can use the -mtime (can be used filter files based on the last mod time), -name, -type and other useful flags
|
|
||||
|
Here I can move the files on remote server to a different directory.
But how come the local server knows that it shouldn't transfer already transferred files in the next hour run ? The files that gets created are 500 MB each time. here how can I use the filter command ? Thanks, Radhika. |
|
||||
|
Hi angheloko,
why not use find instead of ls in filtering the files that needs to be copied, that way you can use the -mtime (can be used filter files based on the last mod time), -name, -type and other useful flags I know using the mtime with days (number of days). I don't know how to use modified time like for the past 1 hour,2 hours ? Could you please give me a hint on this ? Thanks, Radhika. |
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|