0

Scenario:

2 Servers (*.12 and *.13)

CakePHP "application" on both of them.

*.12 is "Production" Server
*.13 is "Development" Server

Now I want to copy all files modified in the last 2 days from the test server to the production server WITHOUT the directory ./tmp

I can find them on the production server with:

find ./ -type d -name tmp -prune -o  -mtime -2 -exec ls {} \;

On both servers I have only ssh access.

1

Although this doesn't grab things only modified in the last two days, you probably want rsync to keep your files in sync:

rsync -av --delete --exclude=./tmp/* ./ user@production:/path/

For the find command, you can uses scp:

find ./ -type d -name tmp -prune -o  -mtime -2 -exec bash -c 'scp "$1" user@production:/path/"$1"' -- {} \;
| improve this answer | |
  • Thanks.. will need to setup rsync then on the development first i think... – Michael Grenzer Mar 30 '13 at 18:19
  • @MichaelGrenzer It's installed by default on most Linux systems. The transfer is done over SSH. – jordanm Mar 30 '13 at 18:20

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.