Problems with cron jobs Exit 127

abkrim

Well-Known Member
Sep 5, 2009
97
1
48
Zamora (España)
castris.com
I'm trying to use cronjobs for my backup system.

But all execution get a infamous error:

Code:
Jun 26 21:47:01 pro03 /USR/SBIN/CRON[687624]: (root) CMD (root ; cd /root/; sh /root/backup.sh 696 > /dev/null 2>&1)
Jun 26 21:47:03 pro03 /USR/SBIN/CRON[687622]: (CRON) error (grandchild #687624 failed with exit status 127)

I searched on google (Stack, forums, Debian, etc) and not solution for problem.

I put a test:

simple cron for run a bash with this
Code:
#!/bin/shecho  "$(date +%Y%m%d) $1" > $(date +%Y%m%d%H%M).txt

line cronjob
Code:
*/1 * * * * sh /root/test.sh 300 > /dev/null 2>&1

And not problem

Like run this...

Code:
#!/bin/sh
umount /mnt/backups/
case $1 in
    696 )
       echo "Backup kvm696"
       #kvm696 Dropbox 200GB
       lvcreate -L10G -s -n /dev/saXXXX
       ....


Try cronjob
Code:
13 2 * * * root sh /root/backup.sh 300 > /dev/null 2>&1
13 2 * * * sh /root/backup.sh 300 > /dev/null 2>&1
13 2 * * * root ; cd /root/; sh /root/backup.sh 300 > /dev/null 2>&1

Any work.

All fail with 127 exit.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!