Full remote server backup over cstream using tar (excluding unnecessary files) (reports every 10 seconds)

tar -cj / -X /tmp/exclude.txt | cstream -v 1 -c 3 -T 10 | ssh user@host 'tar -xj -C /backupDestination'
The files are automatically uncompressed when they reach the destination machine. This is a fast way to backup your server to your local computer while it's running (shutting down services is recommended). A file named "exclude.txt" is needed at /tmp/ containing the following : /dev/* /media/* /mnt/* /proc/* /sys/* /tmp/* /home/*/.local/share/Trash /home/*/.gvfs /home/*/.cache /home/*/.thumbnails /etc/fstab /lib/modules/*/volatile/.mounted /var/run/* /var/lock/* /var/tmp/* /var/cache/apt/archives/* /lost+found/*
Sample Output
895643648 B 854.2 MB 2125.2 s (35:25 min) 421438 B/s 411.56 KB/s
898371584 B 856.8 MB 2132.5 s (35:32 min) 421280 B/s 411.41 KB/s
901783552 B 860.0 MB 2139.8 s (35:39 min) 421431 B/s 411.55 KB/s
904785920 B 862.9 MB 2147.0 s (35:46 min) 421420 B/s 411.54 KB/s
908300288 B 866.2 MB 2154.0 s (35:54 min) 421678 B/s 411.79 KB/s
911953920 B 869.7 MB 2161.2 s (36:01 min) 421969 B/s 412.08 KB/s
914890752 B 872.5 MB 2168.4 s (36:08 min) 421929 B/s 412.04 KB/s
919408640 B 876.8 MB 2175.4 s (36:15 min) 422647 B/s 412.74 KB/s
923365376 B 880.6 MB 2182.6 s (36:22 min) 423061 B/s 413.15 KB/s

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: