Problems with cron not executing scripts

Hello people, i have some problems with executing scripts with cron. I’ve enabled the service and it’s running, but it’s not executing my scripts correctly.
[mainstream@oxytocine-pc ~]$ ps -ef | grep crond
root 438 1 0 09:56 ? 00:00:00 /usr/bin/crond -n
mainstr+ 2540 1948 0 10:13 pts/0 00:00:00 grep --colour=auto crond

crontab -e
@reboot /usr/local/bin/rsyncdrive > /dev/null 2>&1
@hourly /usr/local/bin/rsyncdrive > /dev/null 2>&1
@reboot bash -l /usr/local/bin/m3u 2> /tmp/crontab_script_log.txt 2>&1

The log file is created but empty

m3u file:
#!/bin/sh
#Download playlist
wget [randomurl] -O /home/mainstream/Downloads/playlist.m3u

(the url is obfuscated)

The m3u file is created but also empty

I have the same problem with the rcsyncdrive, am i doing something wrong? Everything works when i manually execute the commands? Missing path variables or something?

Cron is the old way the modern way is to use systemd “service” and “timer” units.

IIRC SystemD translates old-style “cron” files into a combination of what I mentioned above.
There might be some incompatibilities or problem there, so try to make the entries self instead.

In a nutshell:

  • Create a service unit that executes some command(s)
  • Create a timer unit that starts the similar named service unit at specific date/time/interval.
  • You only need to “enable” the timer unit, so it auto starts at boot time.

You can manually start the service unit while testing modifications and retrieve log/info about it.

Ahh great thank you so much for clarifying this :slight_smile: I was going in endless loops