#! /bin/sh . /etc/sysconfig/network BACKUPDIR=/mnt/Backup/`hostname` if [ ! -d $BACKUPDIR ] then mkdir $BACKUPDIR fi #--------------------------------------------------- cd / D=`LANG=C date +%a` for DIR in * do case $DIR in home) tar zcvf $BACKUPDIR/$HOSTNAME-httpd.$D.tar.gz home/httpd tar zcvf $BACKUPDIR/$HOSTNAME-yamasita.$D.tar.gz home/yamasita ;; lost+found|mnt|proc|tmp) ;; *) tar zcvf $BACKUPDIR/$HOSTNAME-$DIR.$D.tar.gz $DIR ;; esac done #--------------------------------------------------- GZFILE=$BACKUPDIR/$HOSTNAME-rpm-qa.$D.gz rpm -qa|sort | gzip > $GZFILE #--------------------------------------------------- GZFILE=$BACKUPDIR/$HOSTNAME-chkconfig--list.$D.gz /sbin/chkconfig --list | gzip > $GZFILE
[root@gawa root]# mkdir /mnt/Backup [root@gawa root]# sh /usr/local/sbin/Backup bin/ bin/bash : : www/ www/script/ www/script/melsub_shutdown.sh [root@gawa root]#
[root@gawa root]# crontab -e : "/tmp/crontab.622" 1 line, 72 characters [E] crontab: installing new crontab [root@gawa root]# crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.622 installed on Fri Dec 23 13:46:00 2005) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) 10 4 * * * nice /bin/sh /usr/local/sbin/Backup 2>/dev/null 1> /dev/null [root@gawa root]#
← HS-DGL! + ハックキット 2.0:時刻同期 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ HS-DGL! + ハックキット 2.0:バックアップ(2) |