From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,e0550b7ddce5863e,start X-Google-Attributes: gidfa528,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!r44g2000cwb.googlegroups.com!not-for-mail From: "Mehlwurm" Newsgroups: comp.unix.tru64 Subject: a cron problem Date: 30 May 2006 06:06:25 -0700 Organization: http://groups.google.com Message-ID: <1148994384.922588.237360@r44g2000cwb.googlegroups.com> NNTP-Posting-Host: 194.49.221.254 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1148994390 13778 127.0.0.1 (30 May 2006 13:06:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 May 2006 13:06:30 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.4) Gecko/20030619 Netscape/7.1 (ax),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 S1PS Complaints-To: groups-abuse@google.com Injection-Info: r44g2000cwb.googlegroups.com; posting-host=194.49.221.254; posting-account=L-DUGQ0AAADslts-klmcaR5mUlec1rqB Xref: g2news2.google.com comp.unix.tru64:392 Hi, I have trouble with a cron job, which should save a database. I wrote a script (attached) and it works, if I start it, but if cron wants to start it I get the .tar.gz file but it is just 176KB and not 5000KB :-( I don=B4t know where the problem can be ... have asked in many forums and a lot of people ... i hope you can help me ... the script: <<<< #!/bin/ksh # In der Datei "liste" sind die zu sichernden DB's anzugeben ### in liste are the names of the DB # set -x cd /usr/users/dms/bin dir=3D`pwd` for db in `cat liste` do tar=3D""$db"_by_cron_`date +%d%h%y_%H%M`.tar" rm -rf db_tmp_dir mkdir db_tmp_dir cd db_tmp_dir /usr/users/dms/bin/copydb -c $db 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 env exit >>>>> copydb is a binary, which works and is available i m using a true64 the error mail looks like: <<<< mgodms51> mail >>From root Thu May 18 10:41:00 2006 Received: by mgodms51 id k4IAf0e101791; Thu, 18 May 2006 10:41:00 GMT Date: Thu, 18 May 2006 10:41:00 GMT From: system PRIVILEGED account Message-Id: <200605181041.k4IAf0e101791@mgodms51> + cd /usr/users/dms/bin + + pwd dir=3D/usr/users/dms/bin + cat liste + + date +%d%h%y_%H%M tar=3Dkrhlive_by_cron_18May06_1040.tar + rm -rf db_tmp_dir + mkdir db_tmp_dir + cd db_tmp_dir + /usr/users/dms/bin/copydb -c krhlive + sql -f8F79.38 krhlive + /usr/users/dms/bin/2_secure_script[29]: /usr/users/dms/bin/db_tmp_dir/copy.out: cannot open + pwd + sed s+/usr/users/dms/bin/db_tmp_dir+.+ + /usr/users/dms/bin/2_secure_script[30]: /usr/users/dms/bin/db_tmp_dir/copy.in: cannot open + mv /usr/users/dms/bin/db_tmp_dir/new_copy.in /usr/users/dms/bin/db_tmp_dir/copy.in mv: rename /usr/users/dms/bin/db_tmp_dir/new_copy.in to /usr/users/dms/bin/db_tmp_dir/copy.in: No such file or directory + tar -cf krhlive_by_cron_18May06_1040.tar * tar: * : No such file or directory + chmod 777 krhlive_by_cron_18May06_1040.tar + gzip -9 krhlive_by_cron_18May06_1040.tar + mv krhlive_by_cron_18May06_1040.tar.gz /usr/users/dms/backup/BY_CRON + cd .. + rm -rf db_tmp_dir + + date +%d%h%y_%H%M tar=3Dtrainer_by_cron_18May06_1040.tar + rm -rf db_tmp_dir + mkdir db_tmp_dir + cd db_tmp_dir + /usr/users/dms/bin/copydb -c trainer + sql -f8F79.38 trainer + /usr/users/dms/bin/2_secure_script[29]: /usr/users/dms/bin/db_tmp_dir/copy.out: cannot open + pwd + sed s+/usr/users/dms/bin/db_tmp_dir+.+ + /usr/users/dms/bin/2_secure_script[30]: /usr/users/dms/bin/db_tmp_dir/copy.in: cannot open + mv /usr/users/dms/bin/db_tmp_dir/new_copy.in /usr/users/dms/bin/db_tmp_dir/copy.in mv: rename /usr/users/dms/bin/db_tmp_dir/new_copy.in to /usr/users/dms/bin/db_tmp_dir/copy.in: No such file or directory + tar -cf trainer_by_cron_18May06_1040.tar * tar: * : No such file or directory + chmod 777 trainer_by_cron_18May06_1040.tar + gzip -9 trainer_by_cron_18May06_1040.tar + mv trainer_by_cron_18May06_1040.tar.gz /usr/users/dms/backup/BY_CRON + cd .. + rm -rf db_tmp_dir + env PATH=3D:/usr/bin LOGNAME=3Ddms USER=3Ddms SHELL=3D/usr/bin/sh HOME=3D/usr/users/dms PWD=3D/usr/users/dms/bin + exit ************************************************* Cron: The previous message is the standard output and standard error of the following crontab command: /usr/users/dms/bin/2_secure_script ?=20 >>>>>>>> please help me !!!=20 many thanks Mehlwurm