简体   繁体   中英

I am getting error when executing flock command

when I am trying to execute flock through cron job I am getting error.

I am executing

* * * * * /usr/bin/flock -n /usr/local/monitor/asdp_cloudwatch/run_asdp0101.sh

and I am getting below error

/usr/bin/flock: bad number: /usr/local/monitor/asdp_cloudwatch/run_asdp0101.sh

Can anyone solve this. Help can be appreciated.

flock needs a lock file and a command to run. You've only specified one argument. I'm assuming that it is the command, so must also specify the command to run. Something like that:

* * * * * /usr/bin/flock -n /path/to/lockfile /usr/local/monitor/asdp_cloudwatch/run_asdp0101.sh

You need to adjust /path/to/lockfile of course.

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