2

I put my shell script inside /etc/cron.daily

I was hoping everything that in that folder would be run daily but my script is not being ran.

  • What is the name of your script? Does it conform to the conventions listed in the DEBIAN SPECIFIC section of the cron manpage? – steeldriver Nov 16 '16 at 23:38
  • 2
    solved the problem by adding #! /bin/bash to line 1 and renaming sync.sh to sync -- don't know how to answer my own question on here. – physiii Nov 17 '16 at 15:15
3

Keep in mind that scripts installed in /etc/cron.{hourly|daily|weekly|monthly} must be executable, for run-parts to process them.


Update: Indeed, defining the shebang is also mandatory in cron scripts for run-parts to process them. And as a general rule: you should always set one.

  • Okay, I ran sudo chmod +x /etc/cron.daily/sync.sh -- we'll see if that works. All that's in the script is: sh /home/physiii/sync.sh >> /var/log/sync 2>&1 & – physiii Nov 17 '16 at 14:31
  • solved the problem by adding #! /bin/bash to line 1 and renaming sync.sh to sync -- don't know how to answer my own question on here. – physiii Nov 17 '16 at 15:14

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