Skip to content

Instantly share code, notes, and snippets.

@romiras
Created July 16, 2015 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save romiras/133c2173e4de8fa82d1f to your computer and use it in GitHub Desktop.
Save romiras/133c2173e4de8fa82d1f to your computer and use it in GitHub Desktop.
Full system backup with dar
#!/bin/bash
# Full system backup with dar. Refer to http://dar.linux.free.fr/doc/Tutorial.html
## Configuration
# path to store dar backup files
Storage=/mnt/disk/backup/Linux
# name of system
SysName=Ubuntu_`. /etc/os-release; echo ${VERSION_ID/*, /}`
# "-z2" - fast but weak compression
# "-Z" - do not try to compress these types of names (i.e. archives)
# "-P" - do not store contents of these directories. See documentation for more details.
sudo dar -c $Storage/linux-$SysName-root-full-`date +%Y-%m-%d` -z2 -D -R / \
-Z "*.gz" -Z "*.bz2" -Z "*.zip" -Z "*.png" -Z "*.xz" \
-P dev/pts -P sys -P proc \
-P tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment