Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I load all the files created in last 24 hours from a server X to server Y through a script (both being linux servers)?

I do know that the command find . -mtime -1 -exec cp '{}' <new_dir> would copy all the files in current directory to . But I am not sure how to do this for a located on another server.

share|improve this question
    
Run find on the other server instead of in . on the local machine? –  geekosaur Apr 25 '12 at 19:43
2  
-mtime finds modified files, not created files. There's a difference. What you're looking for sounds like rsync. –  Daniel Beck Apr 25 '12 at 19:43
add comment

2 Answers

up vote 3 down vote accepted

Take a look at rsync. It could be a good match for your needs.

share|improve this answer
add comment

Just replace cp with scp and set up an ssh key pair without a passphrase.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.