LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   howto backup (https://www.linuxquestions.org/questions/linux-newbie-8/howto-backup-628785/)

zeeshanhayat 03-22-2008 12:37 AM

Ever tried Clonezilla. I think its the best available Open Source option to create Norton Ghost like images.

jogurnog 03-22-2008 08:17 PM

ok this is my current situation:
  • I've split /media/HARD DRIVE into 4 partitions; disk-1, disk-2, disk-3 and the original partition with my Vista backup is in there. (using GParted)
  • used mkdir /backup (was i to use it under a 'cd /media/disk-2' ?)
  • ive written the code in /etc/fstab ( /dev/sda3 /backup ext3 defaults 0 2 )

ready for next orders, please and thank you

jogurnog 03-23-2008 02:43 PM

bump bump bump

jailbait 03-23-2008 02:51 PM

If you haven't already formated /dev/sda3 then do so now:

umount /dev/sda3
mkfs.ext3 /dev/sda3
mount -t ext3 /dev/sda3 /backup


Now decide on how many versions of the backup you are going to keep. Issue the du command for every partition you plan to back up. For example if you have / and /home partitions you would use:

du -s -h -x /
du -s -h -x /home

This will give you the total amount of space needed for a single generation of your backup. Then set up directories in /backup for how many generations of backup you want to keep. If you want to keep two generations then you need:

mkdir /backup/backup1
mkdir /backup/backup2

Then you need to create scripts for each backup generation. Note that if you backup / you can get into an iteration problem by attempting to backup /backup to /backup/backup1 or /backup/backup2. So you need to use the -x option in cp which tells cp to not cross partition mount points. Using -x also means that if you have your system in more than one partition you will need a cp command for each partition.

cp -aux / /backup/backup1
cp -aux /home /backup/backup1

and the second script:

cp -aux / /backup/backup2
cp -aux /home /backup/backup2

In the above example I am not sure if the /home mount point will be copied by the cp / command. If it isn't then try:

cp -aux / /backup/backup1
if test ! -d /backup/backup1/home;
then
mkdir /backup/backup1/home
fi
cp -aux /home /backup/backup1


Once you decide how many versions you want and how many scripts you need then we can work on automating those scripts through cron.

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

jailbait 03-23-2008 02:54 PM

Quote:

Originally Posted by jogurnog (Post 3097352)
  • I've split /media/HARD DRIVE into 4 partitions; disk-1, disk-2, disk-3 and the original partition with my Vista backup is in there. (using GParted)
  • used mkdir /backup (was i to use it under a 'cd /media/disk-2' ?)
  • ive written the code in /etc/fstab ( /dev/sda3 /backup ext3 defaults 0 2 )

/backup should be in your / partition so you don't need to cd to anywhere to create /backup:

mkdir /backup

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


All times are GMT -5. The time now is 07:04 AM.