0

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.

2
  • Run find on the other server instead of in . on the local machine?
    – geekosaur
    Apr 25, 2012 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, 2012 at 19:43

2 Answers 2

3

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

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .