Backup script

Backup script

Post by Dataware Solutio » Tue, 14 Sep 1993 22:31:32



Does anyone have a shell script that I can use to automate ufsdump
in Solaris 2.1.  We have one file system that we need automatically
backed up nightly and I was wondering if anyone has a job that will
do that?  Any help will be greatly appreciated.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        +---------------+             |    Phone:    (617) 647-7674
        |D A T A W A R E|             |    Fax:      (617) 647-1606

        +---------------+             |
 Information Technology Consulting    |

 
 
 

Backup script

Post by Willard Daws » Wed, 15 Sep 1993 05:03:16



>Does anyone have a shell script that I can use to automate ufsdump
>in Solaris 2.1.  We have one file system that we need automatically
>backed up nightly and I was wondering if anyone has a job that will
>do that?  Any help will be greatly appreciated.

--------------------------------------------------------------------------
#!/bin/sh
${BINDIR}/ufsdump 0uf /dev/rmt/0ln /dev/rdsk/c0t3d0s0 >> /usr/tmp/DUMP-log
${BINDIR}/ufsdump 0uf /dev/rmt/0ln /dev/rdsk/c0t3d0s6 >> /usr/tmp/DUMP-log
${BINDIR}/ufsdump 0uf /dev/rmt/0ln /dev/rdsk/c0t3d0s3 >> /usr/tmp/DUMP-log
${BINDIR}/ufsdump 0uf /dev/rmt/0ln /dev/rdsk/c0t3d0s7 >> /usr/tmp/DUMP-log
${BINDIR}/ufsdump 0uf /dev/rmt/0ln /dev/rdsk/c0t3d0s5 >> /usr/tmp/DUMP-log
${BINDIR}/ufsdump 0uf /dev/rmt/0ln /dev/rdsk/c0t2d0s3 >> /usr/tmp/DUMP-log
/usr/bin/mt -f /dev/rmt/0l offline
--------------------------------------------------------------------------
... where ...

/            on /dev/dsk/c0t3d0s0
/usr         on /dev/dsk/c0t3d0s6
/export      on /dev/dsk/c0t3d0s3
/export/home on /dev/dsk/c0t3d0s7
/opt         on /dev/dsk/c0t3d0s5
/solid2      on /dev/dsk/c0t2d0s3
--
Willard Dawson, BellSouth Advanced Networks, 1000 Holcomb Woods Pkwy Ste 412
Atlanta, GA  30076, Voice: +1 404 594 6737, UUCP: kd4nc!vdbsan!wdawson



 
 
 

Backup script

Post by Wolfgang Ratzka t20 » Wed, 15 Sep 1993 16:44:43



: >Does anyone have a shell script that I can use to automate ufsdump
: >in Solaris 2.1.  We have one file system that we need automatically
: >backed up nightly and I was wondering if anyone has a job that will
: >do that?  Any help will be greatly appreciated.

: --------------------------------------------------------------------------
: #!/bin/sh
(...stuff deleted...)

This is only part of the solution since you would like to make sure
the file systems backed up are idle. Else your backup tapes won't be
very useful.

One idea would be to create a special intialization state for use by
shutdown, such that going to this state would go to single user mode,
write the disks to tape and restart full multiuser mode again.
Would this work?

If the disk concerned is not one of the system disks I'm sure there
could be an easier solution. (Simply stop NFS services and starting
them again?)

Any other ideas/comments?

--
     _
 |  | )

 
 
 

Backup script

Post by Dan Ka » Thu, 16 Sep 1993 10:29:42


An easy way to make sure the disks are idle is to lock the file systems as you do
the backup.  Sun sells a program called "lockfs" with backup copilot and Disk
Suite products.

I don't think it is included with other versions of SunOS, but I don't know.  The
version of dump that comes with Copilot will lock the file system before doing
the backup and unlock it afterwords.

SunOS 4.1.1 requires a kernel hack to support this but all the later kernels
should have this built in.

The real problem, if you don't want to spend the money, is to figure out how to
write lockfs yourself.  I used to have some of the details, but seem to have lost
them.  Basically there are ioctls for locking a UFS.

In /usr/include/sys/filio.h I see:

/* file system locking */
#define FIOLFS          _IO(f, 64)              /* file system lock */
#define FIOLFSS         _IO(f, 65)              /* file system lock status */
#define FIOFFS          _IO(f, 66)              /* file system flush */

/* short term backup */
#define FIOAI           _IO(f, 67)              /* allocation information */
#define FIODUTIMES      _IO(f, 68)              /* delay update access time */#define FIODIO          _IO(f, 69)              /* delay write all data */
#define FIODIOS         _IO(f, 70)              /* status of FIODIO */

#endif /*!_sys_filio_h*/

These were provided with backup copilot, however sun appears to have neglected to
include an updated man page for filio.  If you've got them in your kernel you
might be able to figure it out.

Good Luck,
--dan




|>
|> : >Does anyone have a shell script that I can use to automate ufsdump
|> : >in Solaris 2.1.  We have one file system that we need automatically
|> : >backed up nightly and I was wondering if anyone has a job that will
|> : >do that?  Any help will be greatly appreciated.
|>
|> : --------------------------------------------------------------------------
|> : #!/bin/sh
|> (...stuff deleted...)
|>
|> This is only part of the solution since you would like to make sure
|> the file systems backed up are idle. Else your backup tapes won't be
|> very useful.
|>
|> One idea would be to create a special intialization state for use by
|> shutdown, such that going to this state would go to single user mode,
|> write the disks to tape and restart full multiuser mode again.
|> Would this work?
|>
|> If the disk concerned is not one of the system disks I'm sure there
|> could be an easier solution. (Simply stop NFS services and starting
|> them again?)
|>
|> Any other ideas/comments?
|>
|> --
|>      _
|>  |  | )

 
 
 

1. afio backup scripts incremental backup problem

After installing gcc 2.6.2 (I had a g++ internal error so thought an upgrade
was worth a shot) and XFree86 3.1 I though an incremental backup was in order.
[The installion was very hairy due to the need to cp -aR and rm -rf some
important stuff to move things between my two very full volumes (both >90%).
Doing this stuff from a boot disc is not something I like because if you
make a mistake then something important has been nuked!]. I changed
/usr/lib to a symlink to /hd2/usr/lib and installed the new libraries.
However the incremental was empty despite the extensive file system
reorginisation... the same problem occured after even more file system
re-orginisation. Anyone got a fix?

Duncan (-:

2. Announce: New Unix/Linux Jobs and Resumes Board

3. A backup script and backup strategies for linux/Unix

4. Revised paper schedule for SysAdmin and Security Conference

5. Help - Looking For Backup Scripts - Backup 1.0 Problems

6. How is the best FTP Server?

7. Backup script sco 506 / using find command

8. mounting extra free space partition

9. Backup scripts, IP firewalling and IP masquerading

10. Tape backup scripts question (uses afio)

11. Looking for a good Automated backup script

12. tape backup scripts?

13. Q:backup script