Results 1 to 4 of 4
Hi,
I want to backup files and images that are 30 days, 60 days old and so on.. My script below finds all files on a certain directory ($DIR) that ...
- 07-10-2007 #1Just Joined!
- Join Date
- Jul 2007
- Location
- CA
- Posts
- 5
backing up older files using "find" and "scp"
Hi,
I want to backup files and images that are 30 days, 60 days old and so on.. My script below finds all files on a certain directory ($DIR) that are X old days, but the scp command copies all files where I ran the script. I ran it under /home/Files_to_be_Moved/, all files under this folder were moved to the remove /home/data, not only the 30 day or 60 day old files. Can anybody help me? I just want to scp the files found by the "find" command on the script.
find $DIR -type f -mtime +$DAYS -exec scp -r -p -P22000 user@192.168.10.254:/home/data/ \; &
tia
- 07-10-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Try:
RegardsCode:find $DIR -type f -mtime +$DAYS -exec scp -r -p -P22000 {} user@192.168.10.254:/home/data/ \; &
- 07-12-2007 #3Just Joined!
- Join Date
- Jul 2007
- Location
- CA
- Posts
- 5
- 06-18-2008 #4Just Joined!
- Join Date
- May 2008
- Posts
- 15
hi rudysc,
is this command working? or u have any alternate method?
Regards,
Madhi


Reply With Quote
