Re: a cron problem ... now working
- From: "Mehlwurm" <mehlwurm@xxxxxxxxxxxxxx>
- Date: 2 Jun 2006 01:49:54 -0700
in /var/spool/cron/crontabs/root
00 2 * * * su dms -c /usr/users/dms/bin/2_secure_script
das Script:
#!/bin/sh
cd /usr/users/dms/bin
for db in `cat liste`
do
tar=""$db"_by_cron_`date +%d%h%y_%H%M`.tar"
rm -rf db_tmp_dir
mkdir db_tmp_dir
chmod 777 db_tmp_dir
cd db_tmp_dir
/usr/users/dms/bin/copydb -c $db /usr/dbms/ingres/bin/sql -f8F79.38 $db
< /usr/users/dms/bin/db_tmp_dir/copy.out
sed "s+`pwd`+.+" < /usr/users/dms/bin/db_tmp_dir/copy.in >
/usr/users/dms/bin/db_tmp_dir/new_copy.in
mv /usr/users/dms/bin/db_tmp_dir/new_copy.in
/usr/users/dms/bin/db_tmp_dir/copy.in
tar -cf $tar *
chmod 777 $tar
gzip -9 $tar
mv "$tar".gz /usr/users/dms/backup/BY_CRON
cd ..
rm -rf db_tmp_dir
done
exit
funktioniert
THX an alle !
.
- References:
- Re: a cron problem
- From: Mehlwurm
- Re: a cron problem
- From: Michael Tosch
- Re: a cron problem
- Prev by Date: Re: output from a file
- Next by Date: editing PROMPT in csh and bash to include directory names
- Previous by thread: Re: a cron problem
- Next by thread: sed help
- Index(es):