I am trying to find out how I can transfer files from one directory/server to another directory/server?

What I need to consider is that I should transfer files that are created TODAY only. i.e. the folder will look like this:

04/20/2012 <n files>
04/14/2012 <m files>

and if I am running the job today, the script should transfer only the n files that were created today.

Can anyone please help me out how I should do this?


I'm not sure how strict is your requirement: only the files that were created today.

If you're ok with only the files that have changed (or are new), then a possible solution is:

ssh user1@server1 rsync -urv path/to/dir/ user2@server2:/path/to/dir/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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