Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 6th September 2010, 02:49 AM
JimmyTheSaint Offline
Registered User
 
Join Date: Sep 2006
Posts: 25
windows_xp_2003firefox
incremental tar creates wrong file

I had a lot of help over at this thread to set up incremental backups with crontab. I just discovered that tar is not actually incrementing the tar files. I first created the tar files, then in crontab I have:
Code:
 cd /; tar -cpf --incremental --exclude-from=/root/ExcludeFromTar.txt mnt/PATRIOT/bkp/home.tar  home
I only just discovered that this creates a file whose filename is "/--incremental". I also tried using tar's -G switch instead of --incremental:
Code:
 cd /; tar -cpfG --exclude-from=/root/ExcludeFromTar.txt mnt/PATRIOT/bkp/home.tar  home
but this creates a file whose filename is "/G". The contents of /--incremental and /G are my home directory, but why is the target file not being updated? This is the symptom of mistaken syntax in the tar command, but I don't see what's wrong in the command I posted above. What am I missing?
Reply With Quote
  #2  
Old 6th September 2010, 05:12 PM
SiliconSlick's Avatar
SiliconSlick Offline
Registered User
 
Join Date: Aug 2009
Location: College Station, TX
Posts: 501
linuxfedorafirefox
Re: incremental tar creates wrong file

The "f" part takes the next part as a file name. Try:

tar -cpf mnt/PATRIOT/bkp/home.tar --incremental --exclude-from=/root/ExcludeFromTar.txt home
or
tar -cpGf mnt/PATRIOT/bkp/home.tar --exclude-from=/root/ExcludeFromTar.txt home #note G comes before f and the filename is right after f

SS
Reply With Quote
  #3  
Old 8th September 2010, 12:46 AM
JimmyTheSaint Offline
Registered User
 
Join Date: Sep 2006
Posts: 25
windows_xp_2003firefox
Re: incremental tar creates wrong file

D'OH! That was it--thanks. I knew it had to be something totally stupid. I've been using tar for so long and have always automatically put 'f' at the end of my switches to the point that I had no memory of the 'f' switch's actual function. I had now thought tar's syntax just required the files in that order. Of course, I see in tar's man page (way down actually) the function of the 'f' switch. It's amazing that, in 23 years of using tar, I never once ran into this mistake.

Over at the other thread, I did post that the tar files I was supposedly incrementally backing up to each night were not having their timestamps updated. This was clear and immediate evidence that I was using tar wrong, but someone posted that this was correct behavior. That's a mistake: of course incremented tar files get touched and get their timestamps updated, so I can now easily verify that crontab is running tar on schedule.
Reply With Quote
Reply

Tags
creates, file, incremental, tar, wrong

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Browsing SMB share creates a mounted file system? Brent Gardner Using Fedora 1 19th December 2008 07:07 PM
NFS mounts wrong file size nelson-ray Servers & Networking 9 20th November 2006 12:17 PM
Wrong file association rossheth Using Fedora 4 7th May 2006 08:29 PM
What's wrong here? [file: /etc/fstab] doOkiE! Using Fedora 4 16th August 2005 08:01 PM
mplayer too fast + creates .wav dump file DrSteve Using Fedora 0 2nd May 2005 06:42 PM


Current GMT-time: 11:58 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat