Ну приложу я здесь и свою скриптявину ... а то потеряю ещё :)
#!/bin/sh
work_dir="/samba/films/backup/files"
tmp_dir="/samba/films/backup/tmpdir"
backup_list="/samba/films/backup/list"
full_dir="/samba/films/backup/full_dir"
[ ! -d $work_dir ] && mkdir $work_dir
[ ! -d $tmp_dir ] && mkdir $tmp_dir
[ ! -d $backup_list ] && touch $backup_list
[ ! -d $full_dir ] && touch $full_dir
if ([ -f $work_dir/backup-$(date +%Y%m%d)-select.tar.gz ]);
then
echo "File exists. Moving file *select.tar.gz*..."
mv $work_dir/backup-$(date +%Y%m%d)-select.tar.gz $tmp_dir/backup-old-$(date +%Y%m%d)-select.tar.gz
fi
if ([ -f $work_dir/backup-$(date +%Y%m%d)-bases_sql.tar.gz ]);
then
echo "File exists. Moving file *bases_sql.tar.gz*..."
mv $work_dir/backup-$(date +%Y%m%d)-bases_sql.tar.gz $tmp_dir/backup-old-$(date +%Y%m%d)-bases_sql.tar.gz
fi
if ([ -f $work_dir/backup-$(date +%Y%m%d)-full_dir.tar.gz ]);
then
echo "File exists. Moving file *full_dir.tar.gz*..."
mv $work_dir/backup-$(date +%Y%m%d)-full_dir.tar.gz $tmp_dir/backup-old-$(date +%Y%m%d)-full_dir.tar.gz
fi
/usr/local/bin/mysqldump --password=password --all-databases > $work_dir/bases.sql
find /etc/namedb/ -name "*.ru" > /samba/films/backup/list
find /etc/ -name "rc.*" >> /samba/films/backup/list
find /usr/ -name "*.conf" >> /samba/films/backup/list
find /etc/ -name "*.conf" >> /samba/films/backup/list
find /etc/ -name "aliases" >> /samba/films/backup/list
#echo "cobctevenno cam backup"
tar -czf $work_dir/backup-$(date +%Y%m%d)-select.tar.gz `cat $backup_list` 2>&1 | grep -v "Removing leading"
tar -czf $work_dir/backup-$(date +%Y%m%d)-bases_sql.tar.gz $work_dir/bases.sql 2>&1 | grep -v "Removing leading"
tar -czf $work_dir/backup-$(date +%Y%m%d)-full_dir.tar.gz `cat $full_dir` 2>&1 | grep -v "Removing leading" | grep -v "socket ignored"
rm -rf $work_dir/bases.sql
#cmd=`basename $0`
#optfiles="Usage: $cmd"
echo "Congratulations, done backup files"