HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Crontab error (http://www.howtoforge.com/forums/showthread.php?t=61378)

Captain 11th April 2013 10:56

Crontab error
 
Hello!

I have cron to backup my server files to external drive.
When I run it manually it runs without problem.

But script want not work via cron on Debian 6. I have the same script and crontab on Ubuntu 12.04 and it works without problem.

crontab
Code:

* * * * * /usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log
30 00 * * * /usr/local/ispconfig/server/cron_daily.sh > /dev/null 2>> /var/log/ispconfig/cron.log
20 4 11 * * /1/backup_server.sh > /dev/null

error:
Code:

Apr 11 11:20:01 srv /USR/SBIN/CRON[22590]: (root) CMD (/1/backup_server.sh > /dev/null)
Apr 11 11:20:01 srv /USR/SBIN/CRON[22589]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
Apr 11 11:20:01 srv /USR/SBIN/CRON[22585]: (CRON) error (grandchild #22590 failed with exit status 127)

backup script:
Code:

#!/bin/bash
work_dir="/"
bkup_dir="/media/external/"
excl_dir="--exclude=/proc --exclude=/lost+found --exclude=/media/external --exclude=/mnt --exclude=/sys"
date=`date +%Y%m%d`

cd $work_dir

tar cvpzf $bkup_dir/backup_$date.tgz $excl_dir $work_dir

I try to change bin/bash to bin/sh but does not help. Permission to script is 750, permission to /media/external 755

Where is a problem?

Thank you.


All times are GMT +2. The time now is 11:45.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.