SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-12-12 01:01:34

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

[SOLVED] Crontab being wiped on shutdown/reboot?

My crontab appears to be being saved in /tmp, which means it gets deleted on shutdown / reboot.

How to relocate crontab?

(I usually access via

crontab -e

)

Last edited by Joe90 (2013-12-13 00:31:18)

Offline

Be excellent to each other!

#2 2013-12-12 18:35:45

fratermus
#! CrunchBanger
From: 75081, USA
Registered: 2012-01-20
Posts: 149
Website

Re: [SOLVED] Crontab being wiped on shutdown/reboot?

I think the crontab gets exported to a textfile in /tmp, then the editor is called, then the file is sucked back into the crontab.

I don't know what's causing it, but in the meantime you can stop losing work by saving your crontab entry to a file in your homedir or something and using that to repopulate the tab.

crontab -l > cron.bak

Is this an existing install or a new install?   Was cron every keeping the entries correctly?  Does cron perform the entries until reboot?


brother mouse
new to crunchbang.
my first linux kernel build was on a 386-16sx with 6MB SIPP RAM ($50/MB!)

Offline

#3 2013-12-12 22:19:04

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: [SOLVED] Crontab being wiped on shutdown/reboot?

It has been doing it since new install in October, so has always been created in /tmp. I have backed up the entries I made, so any work not lost, just means that none of the jobs run after reboot because they have been cleared.

Where is the file supposed to be (and how would I create it there) and why is it not being created there instead of in /tmp ?

A google search tells me it should be located in

/var/spool/cron/crontabs/#USER

or in my case ;)

/var/spool/cron/crontabs/Joe90

But there is nothing there....

EDIT

Just made a #comment edit using "crontab -e" and a file name Joe90 appeared in the crontabs folder. Will have to see if it persists?

Last edited by Joe90 (2013-12-12 22:36:21)

Offline

#4 2013-12-12 22:52:25

fratermus
#! CrunchBanger
From: 75081, USA
Registered: 2012-01-20
Posts: 149
Website

Re: [SOLVED] Crontab being wiped on shutdown/reboot?

The temporarily edited file being created in /tmp is normal;  it's just a transient file for the user to work on.  (sorry if you already know this stuff -- adding extra for onlookers.)

The part where the resulting crontab disappears after reboot is weird.  Is everything under /var/spool cleared out after reboot?  Maybe some cleanup process getting overzealous.

Watching with interest.  Hopefully someone will chime in with more ideas.


brother mouse
new to crunchbang.
my first linux kernel build was on a 386-16sx with 6MB SIPP RAM ($50/MB!)

Offline

#5 2013-12-13 00:25:01

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: [SOLVED] Crontab being wiped on shutdown/reboot?

Thanks for the info on the transient file, had kind of figured out that was happening but good to have confirmation this is normal as helps to track problem smile

OK on reboot file #USER/Joe90 is removed/gone/deleted from /var/spool/cron/crontabs.

There is a cups folder too under /var/spool but that is empty, other folders under var look OK, e.g. log and cache.

So, I know it is created correctly and in the correct place when i edit with crontab -e, but not why or by what it is being deleted?

Offline

#6 2013-12-13 00:30:54

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: [SOLVED] Crontab being wiped on shutdown/reboot?

Solved it! All my fault. Blame short term memory loss!  mad

Because I am running an SSD I have this in my fstab:

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

Hence why it is going awol on reboot

I'll go to the back of the class and wear the pointy hat for the rest of the lesson  devil

Offline

#7 2013-12-13 00:33:53

porkpiehat
#! Die Hard
Registered: 2012-10-02
Posts: 1,007

Re: [SOLVED] Crontab being wiped on shutdown/reboot?

Last edited by porkpiehat (2013-12-13 01:35:35)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo