SearchRecent postsThe Random ToolboxDrupal 7 Setting up variables for use in a template (preprocess and process functions) Rendering Drupal 7 fields (the right way) Linux Secure Copy (scp) command Restrict Free Shipping in Magento Quickbooks Text Connection Ticket Cross-Site Request Forgery (CSRF) jQuery Events: MouseOver / MouseOut vs. MouseEnter / MouseLeave Monthly archive
|
Tar - exclude filesHow can I keep out certain files when creating a tarball? For example: /home/me/file1 /home/me/dir1 /home/me/dir2 /home/me/abc /home/me/xyz How do I execute zyz and abc file while using a tar command? $ tar -zcvf /tmp/mybackup.tar.gz --exclude='abc' --exclude='xyz' /home/me If you have more than 2 files use -X option to specify multiple file names. It reads list of exclude file names from a text file. For example create a file called exclude.txt: $ vi exclude.txt</code>Append file names:<br> <code>abc<br> xyz<br> *.bak Save and close the file. This lists the file patterns that need to be excluded. Now type the command: $ tar -zcvf /tmp/mybackup.tar.gz -X exclude.txt /home/me Where,
|