Ubuntu 14.04 not running Bash scripts in /etc/cron.daily

675

Solution 1

You cannot have files within /etc/cron.daily (or the other Cron directories) with a "." in the name.
The name must consist of all upper,lower,numbers,hyphens, or underscores. The reason is run-parts will not pickup the files that do not follow this rule.

http://voidtech.wordpress.com/2014/02/13/cron-a-script-in-cron-daily-folder-is-not-executed-fix/ http://justcheckingonall.wordpress.com/2009/06/28/cron-does-not-run-scripts/

Solution 2

The user crontabs, as given by crontab -e or crontab -l, are NOT system crontabs. User crontabs are stored as files within /var/spool/, typically /var/spool/cron/crontab/username

The only safe/clean way to edit these is using crontab -e, as it automatically validates the syntax and complains if you make a mistake, thereby not allowing you to mess up too badly.

However, the OP's query is regarding system cron scripts as at /etc/cron.daily, /etc/cron.weekly, and so forth. Typically these scripts are called due to their being within the crontab file at /etc/crontab. Another set of crontabs are also at /etc/cron.d/*. These, along with the scripts in /etc/cron.{daily,weekly,...} are considered the "system" crons.

These system crons are run regardless of the content of root's crontab, even if root's crontab is completely empty. These crontabs (the crontabs, not the scripts) are also a little different in that there is an extra column (column 6) where you have to specify the username that the entry is to run as. This column is of course unnecessary in the "user" crons.

Share:
675

Related videos on Youtube

Vikash Sharma
Author by

Vikash Sharma

Updated on September 18, 2022

Comments

  • Vikash Sharma
    Vikash Sharma over 1 year

    I tried to run this simple code.

    from RPLCD import CharLCD
    lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])
    lcd.write_string(u'Hello world!')
    

    This is showing the error as

    Traceback (most recent call last):
      File "lcd.py", line 2, in <module>
        lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])
    TypeError: this constructor takes no arguments
    

    Please help me to figure out this

  • geirha
    geirha almost 10 years
    Right. Commands shouldn't have extensions anyway, so that's a good thing.