'crontab not working under arch linux

I tried to set up a schedule to remove the old file and folder after several days. I put the following code in a script file and tried to use crontab to run it every day. The find command worked fine. but the crontab seems not execute the script file.

I also use crontab for other tasks, i.e. rsync, they all work fine. I am wondering what might be the possible reason that crontab won't work in this case. And what could I do alternatively for the job? Thanks!

#!/bin/bash -x

find /media -type d -ctime +18 | xargs rm -rf

my crontab entries are

10 09 * * * /root/rsync-shell.sh &
20 09 * * * /root/chg3gp2avi.sh &
30 09 * * * /root/clean_files_10days.sh &

the first two are the ones I set up before and work fine. The third one is the current one that won't work.



Solution 1:[1]

It's renamed into cronie, so:

    systemctl enable cronie
    systemctl start cronie

double-check:

    ps aux | grep crond

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CiaPan