1.cd ~/scripts/job.sh, what the hell is this? cd a file? 2. It is recommended not to write the script like this: First determine whether the previous process exists. If it does not exist, execute the script directly
When executing a task, you can write a lock. When the next repeated script is executed, it will be judged whether there is a lock. If there is no lock, it will be executed. If there is a lock, it will not be executed.
If you just kill the previous mission, it will be in vain.
1.
cd ~/scripts/job.sh
, what the hell is this? cd a file?2. It is recommended not to write the script like this:
First determine whether the previous process exists. If it does not exist, execute the script directly
Kill the process if present
3. Do not use killall, as this will kill the script you are currently starting, and of course subsequent commands will not be executed.
When executing a task, you can write a lock. When the next repeated script is executed, it will be judged whether there is a lock. If there is no lock, it will be executed. If there is a lock, it will not be executed.
If you just kill the previous mission, it will be in vain.