LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-10-2004, 10:40 AM   #1
reaky
Member
 
Registered: Oct 2003
Posts: 60

Rep: Reputation: 15
incremental backup


hi all
i want to make a backup script to make incremental backup every day on the lastday backup.
can any one hlp me for that
 
Old 03-10-2004, 10:56 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"i want to make a backup script to make incremental backup every day on the lastday backup.
can any one hlp me for that"

I use the cpbk in a cron job to do a daily incremental backup to a backup partition. Here is my script:

# This command saves fedora to a backup disk
# partition
# It only copies files that have changed.
# It removes backup files for which the source file has been deleted.

# If /backup does not exist then error touch and exit
if test ! -d /backup;
then
touch /root/data/backups/cpbk.failed.date
exit 1
fi

if test ! -d /backup/fedora;
then
mkdir /backup/fedora
fi

if test ! -d /backup/fedora/bin;
then
mkdir /backup/fedora/bin
fi
cpbk -q /bin /backup/fedora/bin

if test ! -d /backup/fedora/boot;
then
mkdir /backup/fedora/boot
fi
cpbk -q /boot /backup/fedora/boot

if test ! -d /backup/fedora/dev;
then
mkdir /backup/fedora/dev
fi
cpbk -q /dev /backup/fedora/dev

if test ! -d /backup/fedora/etc;
then
mkdir /backup/fedora/etc
fi
cpbk -q /etc /backup/fedora/etc

if test ! -d /backup/fedora/home;
then
mkdir /backup/fedora/home
fi
cpbk -q -c /root/data/cpbkrc/home.cpbkrc /home /backup/fedora/home

if test ! -d /backup/fedora/lib;
then
mkdir /backup/fedora/lib
fi
cpbk -q /lib /backup/fedora/lib

if test ! -d /backup/fedora/makeCD;
then
mkdir /backup/fedora/makeCD
fi

if test ! -d /backup/fedora/mnt;
then
mkdir /backup/fedora/mnt
fi

if test ! -d /backup/fedora/mnt/cdrom;
then
mkdir /backup/fedora/mnt/cdrom
fi

if test ! -d /backup/fedora/mnt/floppy;
then
mkdir /backup/fedora/mnt/floppy
fi

if test ! -d /backup/fedora/opt;
then
mkdir /backup/fedora/opt
fi
cpbk -q /opt /backup/fedora/opt

if test ! -d /backup/fedora/root;
then
mkdir /backup/fedora/root
fi
cpbk -q -c /root/data/cpbkrc/root.cpbkrc /root /backup/fedora/root

if test ! -d /backup/fedora/sbin;
then
mkdir /backup/fedora/sbin
fi
cpbk -q /sbin /backup/fedora/sbin

if test ! -d /backup/fedora/spare1;
then
mkdir /backup/fedora/spare1
fi

if test ! -d /backup/fedora/spare2;
then
mkdir /backup/fedora/spare2
fi

if test ! -d /backup/fedora/software;
then
mkdir /backup/fedora/software
fi

if test ! -d /backup/fedora/tmp;
then
mkdir /backup/fedora/tmp
fi
cpbk -q /tmp /backup/fedora/tmp

if test ! -d /backup/fedora/var;
then
mkdir /backup/fedora/var
fi
cpbk -q -c /root/data/cpbkrc/var.cpbkrc /var /backup/fedora/var

if test ! -d /backup/fedora/usr;
then
mkdir /backup/fedora/usr
fi
cpbk -q /usr /backup/fedora/usr

# Change cpbk date
touch /root/data/backups/cpbk.date


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 03-10-2004, 11:21 AM   #3
reaky
Member
 
Registered: Oct 2003
Posts: 60

Original Poster
Rep: Reputation: 15
sory but can you show me how do you make it run daily
and what's the meaning of( test !-d )
thanks for help
 
Old 03-10-2004, 03:02 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"what's the meaning of( test !-d )"

That statement checks to see if the directory exists, if not then create the directory.


"can you show me how do you make it run daily"

You put a line in /etc/crontab telling cron to run your script once a day.
See:
man crontab
man cron


---------------------
Steve Stites
 
  


Reply



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 using tar eaglegst Linux - Software 9 02-01-2009 05:00 PM
rsync incremental backup sachin_keluskar Linux - Software 1 06-29-2005 02:09 AM
How to take incremental Backup in postgres minil Linux - Software 1 05-11-2005 04:47 AM
Incremental Backup Utilities Matir Linux - Software 2 03-16-2005 09:34 PM
Incremental Backup shell script. datadriven Linux - General 3 06-02-2004 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:05 AM.

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
Open Source Consulting | Domain Registration