[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scp shall only copy newer files



hi ya 

i dont know of any easy tricks to give scp a "list of files"
	scp  target:/list_of_files  desktop:/home/foo


-- for copying only the last 7 days of changes...
	tar has a --newer option too if you dont like "find"
	( "newer" than the last time it ran)

laptop#  find /etc /home -mtime -7 -type f -print | tar cvf - -T - | \
	 ssh  desktop ( cd /home/foo ; tar xvfp - )

# since we sometimes forget what we did last
#
laptop#  echo " 7-days worth synced on on `date` " \
	> /home/foo/Last_Time_I_Synced.txt

and i typically keep that tar file as a "backup" file ... than i can
easily:
	laptop# find .... | tar zcvf /home/backups/todays.tgz -T -
	laptop# scp /home/backups/todays.tgz  desktop:/home/foo

	desktop# cd /home/foo ; tar zxvfp todays.tgz
	desktop# regenerate new checksum .. update your IDS..etc...
		"actually, carefully check your IDS before updating ;-) "

have fun
alvin
http://www.Linux-Backup.net

On Wed, 20 Feb 2002, Christopher S. Swingley wrote:

> Timo,
> 
> > Right now I am doing a backup from my laptop to my workstation using
> > OpenSSH's secure copy. The problem is that i would like to copy only
> > newer files, cos it also transports my Ogg/Vorbis files (quite some
> > gigabytes) over net -quite not wanted. Is there a way like in normal cp
> > to tell scp that it should compare file's timestamps/sizes before
> > sending any files?
> 
> Use rsync with the -e ssh option.  You'll get rsync's logic (only
> transfer data that's different) and the security / convenience of
> ssh / scp.  You don't need to run the server on either end, but I think
> you probably need the rsync package on both ends.
> 



Reply to: