Backup your /etc/ directory to a tarball with the date

By | 2014/10/03

Backup your /etc! Here is a random useful command I incorporate into various backup strategies.


Note: these are backticks

$ sudo tar -cJf $(date +%F)-$(hostname)-etc-tar.xz /etc/

You are then left with a tarball such as:

2014-10-03-blah.members.linode.com-etc-tar.xz

This could of course be modified for various purposes or run from a cron job.
Rock on,

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.