Created
December 4, 2013 17:55
-
-
Save peterdemartini/7792276 to your computer and use it in GitHub Desktop.
Collection of tar commands. Great for backing up and restoring directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Tar and gzip with excludes | |
tar -zcvf backup.tar.gz --exclude="*.zip" --exclude="*.sql" * | |
#Tar and gzip while putting file in foriegn location | |
tar -zcvf /usr/local/backups/backup.tar.gz * | |
#Just tar | |
tar -cvf /usr/local/backups/backup.tar * | |
#Restore from tar.gz | |
cd /location/to/untar/to | |
tar -zxvf /path/to/backup.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment