?
Solved

Help :Backing up a file system

Posted on 1998-01-23
10
Medium Priority
?
331 Views
Last Modified: 2010-04-21
Hello,
     I was wondering if someone could share some backup scripts with me. Actually I want to back up the /usr/local file system everyday at a particular time(midnight). I want it to backed up  if any changes have been made on the /usr/local file system. ( I believe this is an incremental backup ). Can someone please tell me the cron script in order to do this and where will I have to add this entry( the file ?? )

Waiting for a response.
Thanks
Jeetandra
0
Comment
Question by:jmahtani
  • 5
  • 4
10 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 300 total points
ID: 2008628
put your script into a crontab file (prefered roots crontab).
How to do this depends on your OS. The crontab file should contain somthing like:

59 23 * * *  path_of_your_script

your script may look like this:
#!/bin/sh

cd /usr/local
tar cvf /dev/tape `find . anewer backup.timestamp -print`
touch backup.timestamp


NOTE that tar just copies to your tape. If this should be incremental, the tape must be possitioned at the end. This usually depends on your device.
0
 

Author Comment

by:jmahtani
ID: 2008629
Ahoffman,
         Thanks for replying. I was wondering if you could tell me how to do it by using ufsdump, rather then tar. I believe that by using ufsdump, one can back up only the changes that have been made since the previous day.
Waiting for your response.
By the way, I am using solaris 2.5.1
Thanks,
Jeetandra
0
 

Expert Comment

by:psundstr
ID: 2008630
To use ufsdump you just need to use the command:

ufsdump 1uf /dev/rmt/0 /usr/local

The number "1" specifies what level the dump is.  Level 0 is
a full level dump.  The "u" flag tells ufsdump to update the
dumpdate file so it knows what timestamp to check against for
file changes.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008631
I made a general purpose suggestion, not limited to any UNIX flaviour ;-)

You're lucky if your Solaris can do it that simple way (ufsdump).
0
 

Author Comment

by:jmahtani
ID: 2008632
Hello,
      I have added the following statement to the root crontab ( /var/spool/cron/crontabs/root ), but at 15:15, it does not dump the /usr/local filesystem.
15 15 * * * /usr/sbin/ufsdump 1uf /dev/rmt/0 /dev/rdsk/c1t1d0s7
Can someone please tell me whats going on ???
Waiting for your response.

The following are the contents of the root crontab file :
#ident  "@(#)root       1.12    94/03/24 SMI"   /* SVr4.0 1.1.3.1       */
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
0 2 * * 0,4 /etc/cron.d/logchecker
5 4 * * 6   /usr/lib/newsyslog
15 3 * * * /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
15 15 * * * /usr/sbin/ufsdump 1uf /dev/rmt/0 /dev/rdsk/c1t1d0s7          

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008633
Did you just add this with an editor? Probably you need a special command to edit the crontab files (crontab, cronvi, ..) or your crond must be informed that something changed: send a HUP signal or kill it and restart.
0
 

Author Comment

by:jmahtani
ID: 2008634
I did reboot the system after adding the entry to the cron. So, the crond must have read the entries once again.
Also, when the system was rebooting, it displayed a message something like %root is no user, cron entry not created
Any suggestions ??
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008635
> cron entry not created
check your var/adm/{messages,syslog} if there is more information
you also need to read your man-pages about cron, crontab etc. (sorry I don't have them available)
0
 

Author Comment

by:jmahtani
ID: 2008636
Ahoffman,
         Its working. I checked up the /etc/dumpdates file and it had dumped it at the time that I had specified in the root crontab file.
Thanks.
Jeetandra
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008637
That's what e-e is for ;-)
Thanks for grading.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

840 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