Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.