linux:~ # cat backup_on_CDRW.sh
#!/bin/sh
rm /var/log/backup_on_CDRW.log
date > /var/log/backup_on_CDRW.log
echo "Creer le fichier iso-----------------------" >> /var/log/backup_on_CDRW.log
mkisofs -o /tmp/New_bckp.iso -J -r -R -graft-points -l \
-l -L -no-bak -allow-multidot -q \
pdbs/=/home/database \
docs/=/home/kneko/Documents \
bgd1/=/home/operator/backgrounds.4.Xwin \
bgd2/=/home/operator/backgrounds2.4.Xwin \
dbkp/=/home/kneko/sql.backup \
stig/=/home/kneko/tkseti-3.06 \
stir/=/home/kneko/setiNuxCommander-0.1-pre2 \
root/=/root \
brdl/=/a-graver \
html/=/home/kneko/public_html \
etc/=/etc
>> /var/log/backup_on_CDRW.log
echo "Creer le fichier iso--------------------END" >> /var/log/backup_on_CDRW.log
echo "Effacer le CDRW actuel---------------------" >> /var/log/backup_on_CDRW.log
cdrecord -v -pad speed=4 dev=1,0,0 blank=fast >> /var/log/backup_on_CDRW.log
echo "Effacer le CDRW actuel------------------END" >> /var/log/backup_on_CDRW.log
echo "Graver le CD ------------------------------" >> /var/log/backup_on_CDRW.log
cdrecord -v speed=4 dev=1,0,0 /tmp/New_bckp.iso >> /var/log/backup_on_CDRW.log
echo "Graver le CD ---------------------------END" >> /var/log/backup_on_CDRW.log
date >> /var/log/backup_on_CDRW.log
echo "Tester la descente / le montage du CD -----" >> /var/log/backup_on_CDRW.log
umount /media/cdrecorder >> /var/log/backup_on_CDRW.log
mount /dev/sr3 /media/cdrecorder >> /var/log/backup_on_CDRW.log
echo "Tester la descente / le montage du CD --END" >> /var/log/backup_on_CDRW.log
mutt -a /var/log/backup_on_CDRW.log -s "backup on CDRW report" root < /root/mailbosy.txt
mutt -a /var/log/backup_on_CDRW.log -s "backup on CDRW report" kneko < /root/mailbosy.txt
mutt -a /var/log/backup_on_CDRW.log -s "backup on CDRW report" toila < /root/mailbosy.txt
# Script de backup sur un CDRW
# Doit etre present dans le ROOT crontab
#
# LASTMODIF : 31/08/2002 - 18:28
#
# Ajouter a la liste a sauver : /home/kneko/tkseti-3.06
# Modifier le chemin pdbs : /home/database
linux:~ # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.16763 installed on Sun Mar 2 11:50:24 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# Root crontab master file
# -----------
# reveil MATIN
40,50 6 * * 1,3,5 play /usr/share/sounds/alsa/test.wav
45,50 9 * * 6 play /usr/share/sounds/alsa/test.wav
50,55 6 * * 2,4 play /usr/share/sounds/alsa/test.wav
# -----------
# faire un backup sur CDRW
30 4 * * 0,2,4 sh /root/backup_on_CDRW.sh
# -----------
# faire le menage dans les mailbox
0 0 1 * 3 find / -name "mbox" -exec rm -f {} \;
0 1 3 * 5 find /var/spool/mail -size +1024k -exec compress -f {} \;
# -----------
# faire le menage dans les fichiers core
0 3 2 * 1 find / -name "core" -exec rm -f {} \;
# -----------
# Connection a AOL
30 7,11,13,15,20 * * 1-5 /bin/sh /root/dconnect.sh
30 6,11,13,15,20 * * 0,6 /bin/sh /root/dconnect.sh
linux:~ #
linux:~ # ls -l dconnect.sh
-rwxr-xr-x 1 root root 217 Mar 12 20:32 dconnect.sh
linux:~ # ls -l backup_on_CDRW.sh
-rwxr-xr-x 1 root root 2072 Feb 7 02:46 backup_on_CDRW.sh
|