5

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.

2
  • What is the name of your script? Does it conform to the conventions listed in the DEBIAN SPECIFIC section of the cron manpage? Nov 16, 2016 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, 2016 at 15:15

1 Answer 1

10

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.

2
  • 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, 2016 at 14:31
  • 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, 2016 at 15:14

Not the answer you're looking for? Browse other questions tagged .