copying recently edited files server to server

news_at_celticbear.com
Date: 11/18/05


Date: 18 Nov 2005 11:39:44 -0800

I need to copy all the files created and edited in the last day to a
new server.
scp is possible, as is rsync through ssh, but a pasword challenge is
used every time they're used. And I know you can disable that by using
shared keys, but I'm afraid I have a deadline that learning how to do
that hinders.

My options are to somehow open up one rsync from the new server and
feed it the find command to bring back those files, or add the files in
question to a tar on the older server and then bring the tar over at
one time from the new.

This is what I've been using on the new server to bring files over:

rsync -avz -e ssh (old server).com:/var/www/html/home/ ./

which works beautifully!
Except I can't figure out how to use it with a date condition.
Looking at the "find" man, I see an -exec switch, but then I remembered
that I'm looking for the newer files on the old server, so I'm thinking
I need to run the find from there.

So reading the "find" man I figure out how to find the files, and so I
tried to send them to a tar with:

tar uzvf ./archive.tar `find /var/www/html/home/ -type f -mtime -1
-print`

But u and r (even with a previously created tar) just throws me a
tar: Cannot update compressed archives
tar: Error is not recoverable: exiting now

If someone could just let me know which direction to take this, I can
figure it out. Can I initiate an rsync from the new and somehow send it
the find command to bring in the newer files (best way) or is there a
way to run the find on the old and run a transfer of the found file
unattended, or add the new files to one tar?

Just to test I ran:
gzip `find /var/www/html/home/ -type f -mtime -1 -print`
and that worked great... by zipping up each file where it sits. =)
And any attempt to use a command in the find with -exec sends me:
find: missing argument to `-exec'

Thanks for any help!
-Liam



Relevant Pages

  • How can I restrict incoming root rsync over ssh to specified command?
    ... will use rsync over ssh to pull certain directories from the ssh ... Here's an example of the command, ... Even with the server locked up in a room with no user ...
    (comp.os.linux.security)
  • Re: rsync and ssh simple question
    ... possible to tie an SSH key to a specific command on a remote server, ... For instance, when you run rsync over ssh, the local rsync command ...
    (RedHat)
  • Re: rsync and ssh simple question
    ... > possible to tie an SSH key to a specific command on a remote server, ... > the configured command. ... > For instance, when you run rsync over ssh, the local rsync command ...
    (RedHat)
  • Re: How can I restrict incoming root rsync over ssh to specified command?
    ... Is there a way to implement what I'm trying to do with rsync using ... | And, of course, I've not forgotten what you said about the directory-name ... make a simple cron-job on the server that updates a symlink ... Or write a script that can sanity check the issued command (eg against ...
    (comp.os.linux.security)
  • Re: [SLE] Duplicate Install
    ... Mount your server's root partition to /mnt/server. ... Get the installation.tar.bz2 off your source server or make available somehow. ... into it and do tar xfj installation.tar.bz2 ...
    (SuSE)