Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-11-2004, 03:10 PM
|
#1
|
LQ Newbie
Registered: Jul 2004
Posts: 26
Rep:
|
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
|
|
|
10-11-2004, 03:54 PM
|
#2
|
Senior Member
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170
Rep:
|
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
|
|
|
10-11-2004, 03:57 PM
|
#3
|
Member
Registered: Sep 2004
Distribution: Slackware 10, Gentoo
Posts: 292
Rep:
|
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.
|
|
|
10-11-2004, 04:03 PM
|
#4
|
LQ Newbie
Registered: Jul 2004
Posts: 26
Original Poster
Rep:
|
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
|
|
|
10-12-2004, 12:33 AM
|
#5
|
Member
Registered: Sep 2004
Distribution: Debian, Slackware, Arch
Posts: 65
Rep:
|
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
|
|
|
10-12-2004, 03:22 AM
|
#6
|
Senior Member
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380
Rep:
|
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.
Last edited by TigerOC; 10-12-2004 at 03:25 AM.
|
|
|
All times are GMT -5. The time now is 06:17 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|