Hi list...
I try to make a script to save my computer. I would like tu use tar to create a file and then compress it. I have a directory to save located in a home dir, but inside it a temp dir I dont want to save. I try the --exclude option of tar to discard this one, but it don't seem to work. Someone can help me?
Can i use in the same way the ' -X option to exlude more than 1 dir?
tar --acls --append --exclude /home/web/current/temp -vf /data/save/save.tar /home/web/current/ >> /data/save/sauve.log
Thanks for your help. Guillaume
On Thursday 01 February 2007 09:32, Guillaume wrote:
I have a directory to save located in a home dir, but inside it a temp dir I dont want to save. I try the --exclude option of tar to discard this one, but it don't seem to work. Someone can help me?
Delete the directory or move it then do your tar ball.
On Thursday, Feb 1st 2007 at 09:36 -0500, quoth linuxmaillists@charter.net:
=>On Thursday 01 February 2007 09:32, Guillaume wrote: =>> I have a directory to save located in a home dir, but =>> inside it a temp dir I dont want to save. I try the =>> --exclude option of tar to discard this one, but it don't =>> seem to work. =>> Someone can help me? => =>Delete the directory or move it then do your tar ball.
What a horrible answer!
Yes, the exclude option works. I just tried it. I have some random directory which contains a subdir call images.
531 > tar -cf /tmp/xxx.tar --exclude ./images . 532 > tar -tf /tmp/xxx.tar | grep image ./images.h ./libsprite/image.c ./images.c 533 >
If yours isn't working then maybe you can play around like I did above and/or give us more info.
On Thursday 01 February 2007 09:49, Steven W. Orr wrote:
=>Delete the directory or move it then do your tar ball.
What a horrible answer!
There is nothing horrible about my answer. It did not tell him what he wanted to know about excluding but it did tell him how to accomplish his objective, because he does not want to save that tmp directory anyway.
linuxmaillists@charter.net escribió:
On Thursday 01 February 2007 09:32, Guillaume wrote:
I have a directory to save located in a home dir, but inside it a temp dir I dont want to save. I try the --exclude option of tar to discard this one, but it don't seem to work.
Send the exact command you are using to tar the directory.
Someone can help me?
Delete the directory or move it then do your tar ball.
Sorry to say, but that's stupid.
On Thu, 2007-02-01 at 10:14 -0500, linuxmaillists@charter.net wrote:
On Thursday 01 February 2007 09:49, Steven W. Orr wrote:
=>Delete the directory or move it then do your tar ball.
What a horrible answer!
There is nothing horrible about my answer. It did not tell him what he wanted to know about excluding but it did tell him how to accomplish his objective, because he does not want to save that tmp directory anyway.
I am sorry about this but let me answer a related question which you may be interested in. That is how do you untar a file into an existing directory but not overwrite files with the same name? Use the -k option of tar.
On Thu, 01 Feb 2007 15:32:58 +0100, Guillaume wrote:
Hi list...
I try to make a script to save my computer. I would like tu use tar to create a file and then compress it. I have a directory to save located in a home dir, but inside it a temp dir I dont want to save. I try the --exclude option of tar to discard this one, but it don't seem to work. Someone can help me?
Can i use in the same way the ' -X option to exlude more than 1 dir?
tar --acls --append --exclude /home/web/current/temp -vf /data/save/save.tar /home/web/current/ >> /data/save/sauve.log
Thanks for your help. Guillaume Hi list...<br><br>I try to make a script to save my computer. I would like tu use tar to create a file and then compress it.<br>I have a directory to save located in a home dir, but inside it a temp dir I dont want to save. I try the --exclude option of tar to discard this one, but it don't seem to work. <br>Someone can help me?<br><br>Can i use in the same way the ' -X option to exlude more than 1 dir?<br><br><span style="font-style: italic;">tar --acls --append --exclude /home/web/current/temp -vf /data/save/save.tar /home/web/current/ >> /data/save/sauve.log </span><br><br>Thanks for your help.<br>Guillaume
Someone already explained how to use exclude with tar, so I won't repeat that. I just want to point out that you may want to try rsync instead of tar. It does incremental updates (i.e. it will only copy the files that have modified since the last update), so it saves A LOT of time and cpu if you have big things to backup. It also has an exclude option just like tar. I use it as a cron job hourly, and it works wonderfully.
For instance
rsync -av --exclude=".mozilla/firefox/*/Cache" /home/amadeus /backup/home
will backup /home/amadeus to /backup/home in archive mode (-a), verbose (-v) and will exclude the mozilla cache directory.
Oh, yeah, and you can use it to transfer the files between different machines (using ssh).
rsync -av source user@work.com:destination
On Thursday, Feb 1st 2007 at 10:14 -0500, quoth linuxmaillists@charter.net:
=>On Thursday 01 February 2007 09:49, Steven W. Orr wrote: =>> =>Delete the directory or move it then do your tar ball. =>> =>> What a horrible answer! => =>There is nothing horrible about my answer. It did not tell =>him what he wanted to know about excluding but it did tell =>him how to accomplish his objective, because he does not =>want to save that tmp directory anyway.
Sorry, I disagree. Please don't take this personally, but when I post to a list with potentially trillions of readers, I try to answer the question that's asked. If someone can't figure out how to put on a raincoat, I don't tell him to stay in out of the rain. Would your answer have been different if instead of "tmp" he had his directory named "important_stuff"?
I found my error. The --exclude option, need path without '/' on the end.
tar --acls --append --exclude /home/web/current/temp -vf
/data/save/save.tar /home/web/current/ >> /data/save/sauve.log
tar --acls --append -vf /data/save/save.tar /home/web/current --exclude /home/web/current/temp >> /data/save/save.log
Thanks all for your help.
Guillaume