简体   繁体   中英

/bin/sh: 1: user: not found when running shell script using crontab

Hi I'm getting this error when running the shell script using crontab for the specific user

this my crontab:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
29 22 * * * automation /home/automation/profilecheck/untitled.sh >> /home/automation/profilecheck/profilecheck.log 2>&1

anyone can help with this issue?

Cron jobs running with crontab -e are run as the user who issues that command and thus owns that cronjob. You need to remove the user automation from your command and create/run the cronjob from automation user account.

29 22 * * * /home/automation/profilecheck/untitled.sh >> /home/automation/profilecheck/profilecheck.log 2>&1

O Or you can add your cronjob into /etc/crontab

Or move your cronjob to /etc/cron.d and make sure the user is available and has relevant permissions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM