1日に一回、同じ HDD 内に tar + gzip でバックアップを取る
sil:~# cat /usr/local/sbin/Backup #! /bin/sh BACKUPDIR=/mnt/Backup/`hostname` HOSTNAME=`hostname` if [ ! -d $BACKUPDIR ] then mkdir -p $BACKUPDIR fi #--------------------------------------------------- cd / D=`LANG=C date +%a` for DIR in * do case $DIR in lost+found);; proc);; tmp);; mnt) (cd /mnt/buffalo # bin boot dev etc home lib lost+found mnt proc root sbin share tmp usr var www tar zcvf $BACKUPDIR/$HOSTNAME-buffalo.$D.tar.gz bin boot dev etc home lib root sbin share usr var www ) tar zcvf $BACKUPDIR/$HOSTNAME-yasunari.$D.tar.gz mnt/wk ;; *) tar zcvf $BACKUPDIR/$HOSTNAME-$DIR.$D.tar.gz $DIR ;; esac done #--------------------------------------------------- cd $BACKUPDIR MONTHDIR=`hostname`.`LANG=C date +%y%m` if [ ! -d "$MONTHDIR" ] then mkdir "$MONTHDIR" D=`LANG=C date +%a` mv *.$D.* "$MONTHDIR" fi find . -mtime +90 -exec rm -fr {} \; -print sil:~#
sil:~# sh -x /usr/local/sbin/Backup ++ hostname + BACKUPDIR=/mnt/Backup/sil ++ hostname + HOSTNAME=sil + '[' '!' -d /mnt/Backup/sil ']' + cd / ++ LANG=C ++ date +%a + D=Sun + for DIR in '*' + case $DIR in + tar zcvf /mnt/Backup/sil/sil-bin.Sun.tar.gz bin bin/ bin/bash : :
sil:~# crontab -e : : sil:~# crontab -l */5 * * * * nice /bin/sh /usr/local/sbin/fancontrol 2>/dev/null 1>/dev/null 5 1 * * * nice /bin/sh /usr/local/sbin/Backup 2>/dev/null 1>/dev/null # Hack de rokku!! 20 4 * * * nice /bin/sh /usr/local/sbin/RemoveList.sh 45 4 * * * /sbin/shutdown -r now 15 5 * * * /bin/sh /usr/local/sbin/hackdemarurokuV4.sh 3,33 * * * * nice /bin/sh /usr/local/sbin/CheckList.sh sil:~#
|
← 玄箱/T4 が秋葉原で展示 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 玄箱/T4 は PowerPC |