Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help :Backing up a file system

Posted on 1998-01-23
10
Medium Priority
?
330 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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

650 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