Pi.Alert icon indicating copy to clipboard operation
Pi.Alert copied to clipboard

Feature Request: Move cron to cron.d directory

Open wardy277 opened this issue 5 years ago • 2 comments

I have installed pihole and this on a mini pc i use as a basic home server. This is running ubuntu, so no a pi distro.

Only issue I have encountered is that the cron is installed in the user's crontab, but the scripts usesd relies on sudo. sudo asks for a password prompt so doesnt work for the user on my server

I moved the crons to /etc/cron.d/pialert in the global cron format (sets user to run against) e.g:

PIALERT_HOME="/home/user"
0 3 * * 1      root python3 ${PIALERT_HOME}/pialert/back/pialert.py update_vendors >${PIALERT_HOME}/pialert/log/pialert.vendors.log  2>&1

wardy277 avatar Feb 02 '21 11:02 wardy277

I was about to create the same issue. After installation cron jobs created in current user's cron and executed as installation user, however arp_scan requires "sudo" to run per code below:

arpscan_args = ['sudo', 'arp-scan', '--localnet', '--ignoredups', '--retry=' + str(pRetries)]

As a result jobs failing with permission denied which indicated in log file. I had to move jobs to root cron ("sudo crontab -e") in order for them to run.

eugef66 avatar Feb 02 '21 13:02 eugef66

correct, it is true. sorry for the mistake I will fix it shortly

pucherot avatar Feb 02 '21 13:02 pucherot