LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Backup solution (https://www.linuxquestions.org/questions/linux-newbie-8/backup-solution-241412/)

Dannydy 10-11-2004 02:10 PM

Backup solution
 
Hello,

I have been building my sever, now it time for me to learn how to backup the drive Currently i have 2 scsi drive on the server and mount the second drive as /backup. I like to know what is the best method to back it up. And creating a script to with a cron job


Thankz
Dan

darkleaf 10-11-2004 02:54 PM

I use tar to compress my home folder. I think it's the standard thing to run. I haven't looked at making it cron yet though. *watches thread closely ;)

m00t00 10-11-2004 02:57 PM

tar -cjf backup.tar.bz2 /path/to/folder && mv backup.tar.bz2 /path/to/backup/storage

That could be souped up a whole lot IE putting the dates and etc on the backup archive, but thats the general idea.

Dannydy 10-11-2004 03:03 PM

m00t00

In the begin of the command you place "/path/to/folder "
is that the folder that i want to copy. Can you place a sample for me to better understand it

jordanGSU 10-11-2004 11:33 PM

Hi, I've been experimenting with using tar for backup. One thing I picked up was that it does not preserve file permissions by default. To make it do this, create and restore as follows:
-p is what tells it to preserve permissions
create: tar -cvpzf backup.tar.gz /folder_to_backup
restore: tar -xvpzf backup.tar.gz

hope this helps

TigerOC 10-12-2004 02:22 AM

For another angle I use rsync for backups. I backup my /home partition hourly. rsync is very clever in that it examines the origininal and the previous backup and finds out what has changed and then adds the files that have changed which makes the process very quick. The system I use is controlled via cron and sends a report to the log files. If you want to implement the same system install rsync. The script I use;

I made the following script (./backup) to backup the home partition and the output sent to a log file;
#!/bin/bash
##mount /dev/hda6 on /mnt
mount -t ext3 /dev/hda6 /mnt
##backup files to hda6
rsync --delete-after -avH /home/ /mnt/backup/home > /var/log/backup.log
##umount hda6
umount /dev/hda6

To make it executable do chmod 700 ./backup

to run it do ./backup

I put it in /etc/cron.hourly

The following entry was put in /etc/crontab so that a backup is made 10 min past each hour.

# m h dom mon dow user command
10 * * * * root /etc/cron.hourly/backup

I also use PartImage about once a month to do a mirror image of the drive to the same drive(hda6). PartImage is excellent and I run it off Knoppix.
Hope this gives a new angle.


All times are GMT -5. The time now is 01:42 AM.