Dietpi: Important | Issues with cron jobs calling DietPi scripts

Created on 15 Jul 2018  路  6Comments  路  Source: MichaIng/DietPi

Related issues:

This is a fix everyone should apply, as it breaks DietPi's own cron jobs to work (clearing /var/log hourly + time sync). Currently most cron jobs, executing DietPi scripts, will exit with error.

Fast fix to apply, which will be part of v6.12 as well:

Copy/paste all into term

wget https://raw.githubusercontent.com/Fourdee/DietPi/0f18aa4dc0af8ab910a0173dce8849d5b53c30b0/dietpi/func/dietpi-globals -O /DietPi/dietpi/func/dietpi-globals

For those who are interested:

  • Malicious line is https://github.com/Fourdee/DietPi/blob/master/dietpi/func/dietpi-globals#L266, which leads to tput error exiting the whole script.
  • On v6.9 local lines; (( lines=(${#input_string}+6)/$(tput cols) )) had same error output but without exiting the script, for whatever reason 馃槈. If some shell/bash expert knows why the two lines behave differently, please share, as this is interesting to know and might help to prevent further mistakes on this scripting bases 馃槄.
  • The fix above on the one hand reverts back to separate variable declaration and assignment within arithmetic environment, to assure in case of tput the script goes on, on the other hand prevents tput calls (and terminal animation attempts) at all in non-interactive environments.
Bug Priority High Solution available

All 6 comments

Great! This eliminated hourly error notifications by OMV for me.

Time sync hourly works without problems.

Nice! After fix, cron with dietpi-backup (#1901) is working well.

Ok, lets mark this as closed. Resolved for v6.12 (great work @MichaIng 馃憤 ). In the mean time, solution = https://github.com/Fourdee/DietPi/issues/1923#issue-341325599

i know this is old but i ran this:
wget https://raw.githubusercontent.com/Fourdee/DietPi/0f18aa4dc0af8ab910a0173dce8849d5b53c30b0/dietpi/func/dietpi-globals -O /DietPi/dietpi/func/dietpi-globals
now when i try to install it goes to the drive manager. i exit that and get this:
OK ] DietPi-Software | Installing Sonarr: automatically download TV shows
[ OK ] DietPi-Software | Free space check: path=/ | available=24428 MB | required=500 MB

then it goes to the command prompt.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fourdee picture Fourdee  路  3Comments

Fourdee picture Fourdee  路  3Comments

Invictaz picture Invictaz  路  3Comments

k-plan picture k-plan  路  3Comments

and09 picture and09  路  3Comments