//View Tip #576
Similar Tips
» Finding Newer Files [OR How To Create A Patch File]
» Tar remote dir over SSH
» Comparing local and remote files
» SSH tab completion
» Using ssh as a generic stdin consumer and stdout producer

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
nice ssh username@remoteservername "tar cjf - -C /from/basedir/ dirtocopy" | tar xjvf - -C /to/dir/ ; sleep 120 ; shutdown -P now


Copy the remote directory dirtocopy from the remote server to dir of local machine. Transfer the contents using bzip2 compression. When it's done (even if it fails) wait 120 seconds and power off the machine.


View Comments »




Comments 

Add your comment

Comments are currently disabled
Merlin8000
You might not want to assume success there - a broken pipe could result in the system shutting down with an incomplete copy/backup.  Probably a good idea to replace the ;s with &&
Posted 2009-03-23 13:35:28

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit