Linux Backup

Posted on 2002-07-07
Last Modified: 2012-05-04
Hi All,

I am using RedHat 7.2 and arcserve 7.  

Here are my backup plan:

1. Whole system backup/3month
2. Daily backup: postgresql, qmail and vpopmail

Could anyone provides the backup/restore scripts for (1) and can i do the online backup for (2)?

Thanks a lot!

Best regards,
Question by:d_p2

Accepted Solution

dkloes earned 300 total points
ID: 7134934
Since you are doing a system backup 3 times per month (or is it every 3 months?), I would suggest going to a "normal" minimal backup scheme:

I assume you are using tape backups.
Have two sets of rotating weekly tapes.
Set 1 for the first week, set 2 for the second week.
Have three rotating EOM tapes.  EOY tape.
Daily backup except last business day of the week (Fri or Sat)
You might also consider backing up critical system files on your daily backup - i.e. passwd, group, shadow
System backup at end-of-week
Normal backup commands include tar, cpio, dump

In order for experts to give you more guidance, please answer the following questions:
How much data is being backed up daily?
How many file systems and how much data for full backup?
Capacity of media?

Expert Comment

ID: 7134939
Oops, just noticed you are using Arcserve 7.  Any particular reason for using Archserve such as a mixed OS environment?  If not, you might consider using traditional Unix backup commands to minimize downtime and maximize alternatives.  Using third party software does complicate matters in some respects that may offset the benefits of the software.  Although I am sure some experts will disagree.

Author Comment

ID: 7136559
Thanks dkloes!

For the whole system backup, i think i will backup per quarter.  I am using RAID 1 already, and the total disk space is around 30G.  

For the whole system backup:  
I would like to reduce the downtime and backup as more as relevant files so that the recover time is reduce and the data won't be lost!

I will tar the /, /root, /home, /var, /lib, /opt, /etc, /bin, /usr, /opt to the tape, but i just wonder if the machine is down and i install the basic os and restore the above directories, some files is missing.

For the daily backup (email or db backup)
i think i will stop the service and tar/copy the folder to tape and start the service again.  However, i think it is not a good methods

So, Please comment my methods!

Thanks for your advice!

Best regards,

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.


Expert Comment

ID: 7146660
Sorry it took so long to get back but to you but did not realize the system was using my old e-mail address.

Daily backup - your plan seems to be OK.  tar or cpio is best.  How much data?

System backup - best method would be to have the OS files on one partition and data (including /home) on one or more other partitions.  This would allow you to use dump (image) and restore for the root partition without having to load the OS.  I always worry about selective system backups as you plan.  It also makes it easier to restore since you boot from a rescue disk, prepare the partition and restore from there.

Author Comment

ID: 7151146
hi dkloes,

no need to say sorry and i am very appreciate for your kindly helping hand!

Daily backup
Is there any better solution?

System backup (whole disk)
i will simply use the command
#tar -cvf /dev/st0 /          (Is that right?)
can i use the arcserve to do the system backup?

Thanks a lot!

Best regards,

Expert Comment

ID: 7151319
Still need to know how much data you have and how the disk is partitioned.  Show the output from df.
Still need to know the capacity of your tapes.

tar -cvf /dev/st0 directory1 directory2 ...

Recommend using dump of the root partition.  I will be able to give you better advice when you provide the above information.

Yes you can use Arcserve for both daily and system backups.  I am not current on Arcserve so maybe one of the other experts can help you there.

Author Comment

ID: 7151968
here is my partition info:
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda6              1525856    204248   1244096  15% /
/dev/sda2                31111      5705     23800  20% /boot
/dev/sda5              4127076     38092   3879340   1% /opt
none                    256464         0    256464   0% /dev/shm
/dev/sda9               256667     16220    227195   7% /tmp
/dev/sda3             26858236   2067036  23426880   9% /usr
/dev/sda7              1035660     76244    906808   8% /var

The capacity of the tape is 20GB/40GB

Right, i will use #tar -cvf backupDirectory

I am quite worry about the system backup, as it has some /dev, /proc folder.  I am not sure whether i have to backup or not.  Pls give me the details steps for using dump.  BTW, pls provide the steps for recovery.

Thanks a lot!

Best regards,


Expert Comment

ID: 7153851
Since you have split your OS into separate file systems, this is probably a good place to start:

This should give you enough info to decide whether to use dump, tar, or Arcserve.

Here is a reference for creating a rescue disk:

Expert Comment

ID: 7247497
Just jumping in:

You don't need to worry about most (all?) of the stuff in proc - those are "virtual" files which are used to read or set information in the kernel. Remember that just about everything in *nix can be treated as a file. For example:

cat /proc/uptime
6151882.70 6001163.28

cat /proc/version  
Linux version 2.4.10-4GB ( (gcc version 2.95.3 20010315 (SuSE)) #1 Fri Sep 28 17:20:21 GMT 2001

As for postgresql, you must be sure to do a pg_dump of your database. Unless you wait until the database is inactive and do a clean shutdown, then backup all the data files, then restart the database your backup will probably not be reliable (and may not be usable). Use pg_dump to create a dump file and back up that file (or route the output from pg_dump to your backup device).

Also remember that backup can save your data but you may want to investigate disaster recovery. Check out mindy/mondo (search at which is a program to create a bootable recovery CD for your machine.

Expert Comment

ID: 9088968
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Expert Comment

ID: 9484970
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept comments from dkloes as answer
Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Author Comment

ID: 9493145
Thanks for ur suggestion.
Even though i want to use Arcserve as a backup tools, i still very appreciate for the suggestion of using basic tools!
Thanks a lot!



Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question