This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Cron auto re-create crontabs

Tags: None
(comma "," separated)
ahmadramadhanbinsirajuddin
Registered Member
Posts
2
Karma
0
OS

Cron auto re-create crontabs

Wed Jul 31, 2019 11:02 am
Hello guys,

I have made the task to run the script by installing it in the terminal with
Code: Select all
crontab -e
.
every time i reboot my computer, why file crontab always reset to default,
i have checked cron service with
Code: Select all
systemctl status cron
and give me this

Code: Select all
● cron.service - Regular background program processing daemon
   Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-07-31 17:34:27 WIB; 31s ago
     Docs: man:cron(8)
 Main PID: 671 (cron)
    Tasks: 1 (limit: 4407)
   Memory: 700.0K
   CGroup: /system.slice/cron.service
           └─671 /usr/sbin/cron -f

Jul 31 17:34:27 Mehmed-II systemd[1]: Started Regular background program processing daemon.
Jul 31 17:34:27 Mehmed-II cron[671]: (CRON) INFO (pidfile fd = 3)
Jul 31 17:34:27 Mehmed-II cron[671]: (CRON) INFO (Running @reboot jobs)
Jul 31 17:34:27 Mehmed-II cron[671]: /var/spool/cron: No such file or directory
Jul 31 17:34:27 Mehmed-II cron[671]: /var/spool/cron: created
Jul 31 17:34:27 Mehmed-II cron[671]: crontabs: No such file or directory
Jul 31 17:34:27 Mehmed-II cron[671]: crontabs: created
Jul 31 17:34:27 Mehmed-II cron[671]: crontabs: chowned


I don't know the cron.service can't detect the crontab file and re-create the crontab file every startup. Please help me guys :'(
ahmadramadhanbinsirajuddin
Registered Member
Posts
2
Karma
0
OS

Re: Cron auto re-create crontabs  Topic is solved

Wed Jul 31, 2019 11:51 am
solved guys ,
Computers come with the solid state drives these days and therefore you search for ways to optimize their lifetime and reduce their tear and wear.

Many Linux websites tell you to optimize /etc/fstab by putting /var/spool directory on ramdisk (using tmpfs – temporary filesystem) like this:

tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0

What they however forget to tell you is that this way crontab (or cron) will not work for ordinary users as the cron will gets deleted on every reboot.

Seriously, don’t do it. Just remove this line, keep others, the SSD tear&wear will not happen just beacuase you have your /var/spool (and crontab) on your drive.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]