L
L
lssssssssssl2021-11-23 21:28:38
linux
lssssssssssl, 2021-11-23 21:28:38

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

2 answer(s)
R
Ronald McDonald, 2021-11-23
@Zoominger

There is a suspicion that you are working in Live mode.

V
Valdemar Smorman, 2021-11-23
@smorman

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 question

Ask a Question

731 491 924 answers to any question