I'm still working my way through tar manuals and I'm coming across this problem: creating tarballs is easy, however, when I try to create it to where only files that are newer are added (such as in Pictures, where I don't want multiple backups based by dates), tar complains about it. Does anybody know the right way to do this, given that: 1. The directory you want to backup is $HOME/Pictures 2. The file you want to backup to is $HOME/backups/Pictures.tar.gz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 13:57 -0700, John Meyer wrote:
I'm still working my way through tar manuals and I'm coming across this problem: creating tarballs is easy, however, when I try to create it to where only files that are newer are added (such as in Pictures, where I don't want multiple backups based by dates), tar complains about it. Does anybody know the right way to do this, given that:
1. The directory you want to backup is $HOME/Pictures 2. The file you want to backup to is $HOME/backups/Pictures.tar.gz
What have you tried already so we don't suggest versions of the tar command that have not worked for you? -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Kenneth Schneider wrote:
What have you tried already so we don't suggest versions of the tar command that have not worked for you?
cd $HOME && tar uzf $HOME/backups/Pictures.tar.gz Pictures Result: tar: Cannot update compressed archives -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
John Meyer wrote:
Kenneth Schneider wrote:
What have you tried already so we don't suggest versions of the tar command that have not worked for you?
cd $HOME && tar uzf $HOME/backups/Pictures.tar.gz Pictures
Result:
tar: Cannot update compressed archives
Try it without using compressed files. Some tar functions don't work with compression. You can always compress and uncompress separately from adding files. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Try it without using compressed files. Some tar functions don't work with compression. You can always compress and uncompress separately from adding files.
Okay, here's what I finally came up with cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar Seems to work, but I can't get the incremental backup feature. Any suggestions? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 14:43 -0700, John Meyer wrote:
James Knott wrote:
Try it without using compressed files. Some tar functions don't work with compression. You can always compress and uncompress separately from adding files.
Okay, here's what I finally came up with
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
Seems to work, but I can't get the incremental backup feature. Any suggestions?
tar tzf $HOME/backups/Pictures.tar Pictures.gz should show all of the versions of the files in the original backup. The "u" option will not add additional files that do not exist in the original tar file. I have not used the "G" option to tar for incremental backups so I cannot offer help for that. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Here is what I am trying: cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar And here's the error: tar: Pictures: Cannot open: Is a directory tar: Error is not recoverable: exiting now I guess the other will work just as well, but it still seems a waste of processor time. Kenneth Schneider wrote:
On Sun, 2007-01-21 at 14:43 -0700, John Meyer wrote:
James Knott wrote:
Try it without using compressed files. Some tar functions don't work with compression. You can always compress and uncompress separately from adding files.
Okay, here's what I finally came up with
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
Seems to work, but I can't get the incremental backup feature. Any suggestions?
tar tzf $HOME/backups/Pictures.tar Pictures.gz should show all of the versions of the files in the original backup. The "u" option will not add additional files that do not exist in the original tar file.
I have not used the "G" option to tar for incremental backups so I cannot offer help for that.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 21 January 2007 18:41, John Meyer wrote:
Here is what I am trying:
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
I'm no expert on tar but what you are trying never looked right to me. Just where is this Pictures? a directory off your home directory?? I would think Pictures/* would be the thing to use..
And here's the error: tar: Pictures: Cannot open: Is a directory tar: Error is not recoverable: exiting now
I guess the other will work just as well, but it still seems a waste of processor time.
Kenneth Schneider wrote:
On Sun, 2007-01-21 at 14:43 -0700, John Meyer wrote:
James Knott wrote:
Try it without using compressed files. Some tar functions don't work with compression. You can always compress and uncompress separately from adding files.
Okay, here's what I finally came up with
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
Seems to work, but I can't get the incremental backup feature. Any suggestions?
tar tzf $HOME/backups/Pictures.tar Pictures.gz should show all of the versions of the files in the original backup. The "u" option will not add additional files that do not exist in the original tar file.
I have not used the "G" option to tar for incremental backups so I cannot offer help for that. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Pictures is the directory. I guess I could try the other, but if the first seems to work, why complain I guess. Bruce Marshall wrote:
I'm no expert on tar but what you are trying never looked right to me.
Just where is this Pictures? a directory off your home directory??
I would think Pictures/* would be the thing to use.. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 18:56 -0500, Bruce Marshall wrote:
On Sunday 21 January 2007 18:41, John Meyer wrote:
Here is what I am trying:
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
I'm no expert on tar but what you are trying never looked right to me.
Just where is this Pictures? a directory off your home directory??
I would think Pictures/* would be the thing to use..
According to man page the list can be directories. I tested it further, it still works for me. So, that doesn't seem to be the issue I guess: toshi@suse-102:~/Documents> ls -l total 172 <snip> drwxr-xr-x 4 toshi users 4096 2007-01-21 16:15 Misc drwxr-xr-x 2 toshi users 4096 2007-01-21 16:15 test <snip> toshi@suse-102:~/Documents> ls -l test total 172 -rwxr--r-- 1 toshi users 171936 2005-04-09 19:13 04092005.jpg toshi@suse-102:~/Documents> tar cvf test.tar test test/ test/04092005.jpg toshi@suse-102:~/Documents> tar tvf test.tar drwxr-xr-x toshi/users 0 2007-01-21 16:26:12 test/ -rwxr--r-- toshi/users 171936 2005-04-09 19:13:23 test/04092005.jpg toshi@suse-102:~/Documents> cp Misc/add1.jpg test/. toshi@suse-102:~/Documents> ls -l test total 348 -rwxr--r-- 1 toshi users 171936 2005-04-09 19:13 04092005.jpg -rwxr--r-- 1 toshi users 171936 2007-01-21 16:27 add1.jpg toshi@suse-102:~/Documents> tar uvf test.tar test test/ test/add1.jpg toshi@suse-102:~/Documents> tar tvf test.tar drwxr-xr-x toshi/users 0 2007-01-21 16:26:12 test/ -rwxr--r-- toshi/users 171936 2005-04-09 19:13:23 test/04092005.jpg drwxr-xr-x toshi/users 0 2007-01-21 16:27:21 test/ -rwxr--r-- toshi/users 171936 2007-01-21 16:27:21 test/add1.jpg Toshi -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bruce Marshall wrote:
On Sunday 21 January 2007 18:41, John Meyer wrote:
Here is what I am trying:
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
I'm no expert on tar but what you are trying never looked right to me.
Just where is this Pictures? a directory off your home directory??
I would think Pictures/* would be the thing to use..
Not a good idea IMHO - if you say Pictures/*, then when that archive is untarred, it will barf all over the current working directory, and I hate it when naively constructed tarballs do that. Better to leave it at Pictures, and the untar will confine itself neatly to the Pictures directory. Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 16:41 -0700, John Meyer wrote:
Here is what I am trying:
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
And here's the error: tar: Pictures: Cannot open: Is a directory tar: Error is not recoverable: exiting now
I guess the other will work just as well, but it still seems a waste of processor time.
Please do not top post. Since you are running this from the command line there is no need for cd $HOME just use cd (the cd command by it self takes you to your home (login) directory) gunzip backups/Pictures.tar.gz tar uf backups/Pictures.tar Pictures gzip -9 backups/Pictures.tar ( the -9 means to use maximum compression) -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Though I thank you for the post, whether I top post or bottom post is a matter of personal taste. I prefer to top post. Kenneth Schneider wrote:
Since you are running this from the command line there is no need for cd $HOME just use
cd (the cd command by it self takes you to your home (login) directory) gunzip backups/Pictures.tar.gz tar uf backups/Pictures.tar Pictures gzip -9 backups/Pictures.tar ( the -9 means to use maximum compression)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 17:57 -0700, John Meyer wrote:
Though I thank you for the post, whether I top post or bottom post is a matter of personal taste.
Not! http://en.opensuse.org/Opensuse_mailing_list_netiquette Refer to item #3 -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Kenneth Schneider wrote:
On Sun, 2007-01-21 at 17:57 -0700, John Meyer wrote:
Though I thank you for the post, whether I top post or bottom post is a matter of personal taste.
Not!
http://en.opensuse.org/Opensuse_mailing_list_netiquette
Refer to item #3
How nice. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
And while we're at it, let's see what the -9 does: before adding -9 to the script: total 44523 -rw-r--r-- 1 jmeyer users 44065843 2007-01-21 18:01 Pictures.tar.gz jmeyer@linux-1u45:~/backups> backupfiles.sh After adding -9 jmeyer@linux-1u45:~/backups> ls -al total 44528 -rw-r--r-- 1 jmeyer users 44066020 2007-01-21 18:01 Pictures.tar.gz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 21 January 2007 20:04, John Meyer wrote:
And while we're at it, let's see what the -9 does:
before adding -9 to the script: total 44523 -rw-r--r-- 1 jmeyer users 44065843 2007-01-21 18:01 Pictures.tar.gz jmeyer@linux-1u45:~/backups> backupfiles.sh After adding -9 jmeyer@linux-1u45:~/backups> ls -al total 44528 -rw-r--r-- 1 jmeyer users 44066020 2007-01-21 18:01 Pictures.tar.gz
Photos/graphics data often compresses poorly. Most image formats already include some kind of compression, so they are not likely to compress any further. Text and object files tend to compress a little better. Here's what the man page says about the gzip compression levels: -# --fast --best Regulate the speed of compression using the specified digit #, where -1 or --fast indicates the fastest compression method (less compression) and -9 or --best indicates the slowest compression method (best compression). The default compression level is -6 (that is, biased towards high compression at expense of speed). This is a directory containing a lot of source code compressed with various gzip compression levels: -rw-r--r-- 1 kenjen users 247813 2007-01-21 21:46 csv1.tar.gz -rw-r--r-- 1 kenjen users 185071 2007-01-21 21:46 csv6.tar.gz -rw-r--r-- 1 kenjen users 182500 2007-01-21 21:41 csv9.tar.gz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 21 January 2007 17:41, John Meyer wrote:
Here is what I am trying:
No, you're *NOT* trying to comply with how this list is used and run and read by the majority. <PLONK> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Jan 22 2007 21:06, Charles philip Chan wrote:
On 22 Jan 2007, yonaton@localnet.com wrote:
<PLONK>
Is the killfile a new feature of kmail? ;-)
It has been for several traditional MUAs, I don't see why kmail would be so anachronistic not to have one or some equivalent. -`J' -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I did some test. It works for me as below: toshi@suse-102:~/Documents/test> tar uf test.tar *.jpg toshi@suse-102:~/Documents/test> tar tvf test.tar -rwxr--r-- toshi/users 171936 2005-04-09 19:13:23 04092005.jpg toshi@suse-102:~/Documents/test> ls -l total 528 -rwxr--r-- 1 toshi users 171936 2005-04-09 19:13 04092005.jpg -rwxr--r-- 1 toshi users 171936 2005-04-09 19:13 add1.jpg -rw-r--r-- 1 toshi users 174080 2007-01-21 14:44 test.tar toshi@suse-102:~/Documents/test> tar uf test.tar *.jpg toshi@suse-102:~/Documents/test> tar tvf test.tar -rwxr--r-- toshi/users 171936 2005-04-09 19:13:23 04092005.jpg -rwxr--r-- toshi/users 171936 2005-04-09 19:13:23 add1.jpg Toshi On Sun, 2007-01-21 at 14:43 -0700, John Meyer wrote:
James Knott wrote: Okay, here's what I finally came up with
cd $HOME && tar uf $HOME/backups/Pictures.tar Pictures gzip $HOME/backups/Pictures.tar
Seems to work, but I can't get the incremental backup feature. Any suggestions?
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 14:32 -0700, John Meyer wrote:
Kenneth Schneider wrote:
What have you tried already so we don't suggest versions of the tar command that have not worked for you?
cd $HOME && tar uzf $HOME/backups/Pictures.tar.gz Pictures
Result:
tar: Cannot update compressed archives
cd $HOME && gunzip backups/Pictures.tar.gz && tar uf
$HOME/backups/Pictures.tar Pictures && gzip -9 backups/Pictures.tar
Or if you put all of this into a script file it would look like
******************************************
#!/bin/bash
cd /home/
Quoting John Meyer
Kenneth Schneider wrote:
What have you tried already so we don't suggest versions of the tar command that have not worked for you?
cd $HOME && tar uzf $HOME/backups/Pictures.tar.gz Pictures
Result:
tar: Cannot update compressed archives
JPEG files are already compressed. You will get little further compression and may get expansion. Don't compress the archive and then you can update it. HTH, Jeffrey -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I thought it was more because Pictures.tar.gz was already a tarball. Jeffrey Taylor wrote:
JPEG files are already compressed. You will get little further compression and may get expansion. Don't compress the archive and then you can update it.
HTH, Jeffrey
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-01-21 at 13:57 -0700, John Meyer wrote:
2. The file you want to backup to is $HOME/backups/Pictures.tar.gz
I think you need to unzip it to use -u option. Toshi -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
John Meyer wrote:
I'm still working my way through tar manuals and I'm coming across this problem: creating tarballs is easy, however, when I try to create it to where only files that are newer are added (such as in Pictures, where I don't want multiple backups based by dates), tar complains about it. Does anybody know the right way to do this, given that:
1. The directory you want to backup is $HOME/Pictures 2. The file you want to backup to is $HOME/backups/Pictures.tar.gz
tar -cvf $HOME/backups/Pictures.tar.gz $HOME/Pictures Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (11)
-
Bruce Marshall
-
Charles philip Chan
-
J Sloan
-
James Knott
-
Jan Engelhardt
-
JB
-
Jeffrey Taylor
-
John Meyer
-
Ken Jennings
-
Kenneth Schneider
-
Toshi Esumi