LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-18-2011, 01:17 PM   #1
drsprite
LQ Newbie
 
Registered: May 2011
Location: Massachusetts
Distribution: CentOS and Ubuntu
Posts: 2

Rep: Reputation: Disabled
Incremental backup script question


Hello everyone. A somewhat newbie with a question. After searching Google and coming across 3 FTP backup scripts, I've managed to put together my own hybrid of all 3 of them. Essentially the script will do a full backup on Sundays, and incremental every other day. Then FTP the tar file to an FTP site.

I'm concerned about the incremental portion of this script. I have tried my tar -g to do incremental backups, but since I am ftp'ing the tar files to a Windows machine (yikes), the tar -g results in an "invalid tar file", thus making it difficult to do a one-off file restore. So, I have found that for my setup, using find works best.

Without pasting my entire script, here's a snippet of what I am having trouble with.

Code:
  NOW=$(date +"%Y-%m-%d-%a")
  DIRS="/var/www/html /etc"
  LIST="/backup/inc-list.dat"
  FILE="$NOW-incremental.tar.gz"

  find $DIRS -depth \( -ctime -1 -o -mtime -1 \) -type f -print >> $LIST
  tar -zcvf $BACKUP/$FILE -T $LIST
The find statement here works great for finding all files that were created or modified within the last day, and tarring the results in an incremental tar.

The problem I am having is that it's not capturing renamed folders. For example, if I have a folder containing some web scripts called CURRENT. Typically when I perform an upgrade to the web scripts, I keep an archived copy as a backup. To archive I will rename the entire current folder to OLD, then install the new scripts into a newly created folder called CURRENT.

The issue I am having is that this newly renamed directory OLD isn't being tracked up by the find statement since essentially no files ctime or mtime are changing.

I would like to capture the renamed folder in my incremental backups in case something happens and I need to revert back to the full backup and layer in the incrementals, the most recent changes are reflected.

Your thoughts? Or better yet, know of a better solution for incremental file and folder capture and backup?

Thanks for the help!
 
Old 05-18-2011, 02:38 PM   #2
jothan sans cheer
LQ Newbie
 
Registered: Nov 2010
Location: austria
Distribution: Debian Wheezy
Posts: 11

Rep: Reputation: 1
Unfortunately I cannot answer your question directly, but I do have a handy tool in use. Its called unison and I use it mainly for synchronisation tasks. However it offers some backup capabilities as well and can operate on remote machines as well. Maybe the homepage can tell you if it's suitable for your purposes.

jothan.
 
Old 05-19-2011, 02:08 PM   #3
drsprite
LQ Newbie
 
Registered: May 2011
Location: Massachusetts
Distribution: CentOS and Ubuntu
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you. I will look at this.

In the meantime, anyone else have any suggestions?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
incremental backup jdeeptir Linux - Newbie 5 05-24-2008 07:51 PM
About incremental backup satimis Linux - Software 0 06-15-2006 05:01 AM
incremental backup .... redrobin77 Linux - Software 1 01-31-2006 06:29 AM
Incremental backup script - Tar problem joshheald Linux - Software 1 09-28-2004 11:02 AM
Incremental Backup shell script. datadriven Linux - General 3 06-02-2004 10:19 AM


All times are GMT -5. The time now is 07:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration