CronJob not running

前端 未结 11 1064
攒了一身酷
攒了一身酷 2020-11-22 02:33

I have set up a cronjob for root user in ubuntu environment as follows by typing crontab -e

  34 11 * * * sh /srv/www/live/CronJobs/daily.sh
  0          


        
11条回答
  •  旧巷少年郎
    2020-11-22 02:44

    For me, the solution was that the file cron was trying to run was in an encrypted directory, more specifcically a user diretory on /home/. Although the crontab was configured as root, because the script being run exisited in an encrypted user directory in /home/ cron could only read this directory when the user was actually logged in. To see if the directory is encrypted check if this directory exists:

    /home/.ecryptfs/
    

    if so then you have an encrypted home directory.

    The fix for me was to move the script in to a non=encrypted directory and everythig worked fine.

提交回复
热议问题