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:

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