Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a backup script (rsync via ssh) which is run by cron (configured in /etc/crontab)

0 2   * * *   root    /bin/bash --login /opt/aebackup/sshbackup.sh

If I run it as logged in root like following it runs prefectly fine.

root@server:~# /opt/aebackup/sshbackup.sh

If I run it via cron it would just stop after a while (not always on the same task in the script.. it seems pretty random, like the process is killed at some point randomly)

Does anyone have an idea why my cron would do that? thanks for anything... I'm desperate!

share|improve this question
    
i just found out something really weired.. doesn't make any sense to me. when i use following in crontab it works as expected and solves my problem: 0 2 * * * root /bin/bash --login /opt/aebackup/sshbackup.sh >> /whereever/sshbackup.log –  brickinthewall Jun 22 '11 at 15:20
add comment

2 Answers 2

If you are not interested to an output you can just appen to your command >/dev/null 2>&1... this way it becomes

 0 2   * * *   root    /bin/bash --login /opt/aebackup/sshbackup.sh > /dev/null 2>&1

It should work fine this way, even if it's only a workaround for the bug.

share|improve this answer
add comment

There was a bug in the old cron, for explanation see this launchpad entry.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.