|
Last updated: 05/21/2012
You can exclude files or directories from a tar file like so:
tar -cvf x.tgz /home/user/ --exclude "/home/user/logs"
where x.tgz is the resulting file, /home/user/ is the directory to backup, and /home/user/logs is the directory to exclude.
You can also put all the files / directories into a file, and use the -X switch to exclude all files / directories in the file.
NOTE: you need to use the full path to the file / directory to have it properly excluded from the tar.
blog comments powered by
|