Answer the question
In order to leave comments, you need to log in
Why is crontab file cleared after reboot?
At first I wanted to make pm2 to autostart the program after a reboot, but it also does not autostart the application after a reboot, although startup did it for it.
Then I decided to do @reboot pm2 resurrect via crontab -e
But the crontab file becomes clean after a reboot.
What is wrong with all of them, and how to fix it?
Answer the question
In order to leave comments, you need to log in
In fact, depending on whether you create a task in the scheduler from the User or root, the corresponding files are created in:
/var/spool/cron/crontabs
and the files are:
- if created via sudo (from root), then the root
file
- if from the User (without sudo), then the file user (user_name_in_system)
Accordingly, the processes prescribed in the tasks must correspond to this hierarchy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question