NavigationUser loginSpam?See spam posts on this site? If so, please don't reply to the spam! Instead, just report the URL to the webmaster. |
excluding directories in harddrive backup using tarI want to backup my debian installation using tar but excluding certain directories like /proc and /dev. Also do I need to put the backup file in /tmp and exclude /tmp so that tar won't try to include the file it's creating? I've tried numerous ways with no success. Thanks. |
excluding directories in
Did you try the --exclude or --exclude-from options?
If you need to store the backup file temporarily, then /tmp is the obvious place. You wouldn't want to backup /tmp anyway since by definition it's only for temporary files.
$world=~s/war/peace/g;
excluding directories in harddrive backup using tar
Yes but I'm not sure the syntax was correct. I tried
tar -cvfj backup.tbz / --exclude=/tmp /proc /devand
tar -cvfj backup.tbz / --exclude-from=/tmp /proc /devand got error messages like "no such file or directory" "/proc is a directory" "can not stat"
excluding directories in harddrive backup using tar
The path goes last, and you need to specify --exclude for each file or directory:
tar -cvfj backup.tbz --exclude=/tmp \
--exclude=/proc --exclude=/dev /
The --exclude-from=FILE option allows for listing the exclusions in a file named FILE if you get tired of typing all those excludes :-).