Cron job running, but script not doing anything?

Hey guys, trying to use cron to backup my home server. There’s a nextcloud script I run which I copy and pasted from the nextcloud aio GitHub, and this script works in my sudo crontab. However I have a script for my calibre library which runs perfectly well when run manually but as soon as cron time comes around it shows up in the syslog but the calibre library doesn’t actually get rsynced… I’ll add the calibre script here soon but any ideas in the meantime?

Thanks so much!

InEnduringGrowStrong,
@InEnduringGrowStrong@sh.itjust.works avatar

Errors while running cron jobs often generate “mail” whether you’ve set it up or not.
You can likely check your mail by just running the mail command.

Also, in your crontab, add >> /tmp/cron.log after your script, at least you’ll see whatever logs get generated from that.

Most likely though, the script works when ran manually because it uses your user’s env variables, such as PATH.
I usually just use absolute paths for everything when using cron and this takes care of the vast majority of my issues.

herrvogel,

Check your permissions and your working directory. Forgetting to make sure cron executes the script at the correct location is an easy and common mistake to make.

FMT99,

Theres no other logging it does? Have you tried running the script yourself from the commandline with the same privileges that cron has?

gramie,

Could it be a permission issue? Maybe the cron script isn’t able to access the directory your calibre library is in.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@sh.itjust.works
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • ethstaker
  • osvaldo12
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ngwrru68w68
  • kavyap
  • normalnudes
  • cisconetworking
  • JUstTest
  • InstantRegret
  • khanakhh
  • cubers
  • everett
  • Durango
  • tacticalgear
  • anitta
  • modclub
  • Leos
  • tester
  • megavids
  • provamag3
  • lostlight
  • All magazines