davidtuti
Posts: 85
Joined: Tue Oct 22, 2013 6:21 am

crontab empy why?

Fri Sep 27, 2019 8:45 am

I have a line in crontab. I don't know when but sometime the crontab is empty.

How could I know what happens?

Many thanks and sorry for my English!

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: crontab empy why?

Fri Sep 27, 2019 8:59 am

crontal -l
will show you the contents
suydo crontab -l
will show the root crontab

have you put it in another one ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

davidtuti
Posts: 85
Joined: Tue Oct 22, 2013 6:21 am

Re: crontab empy why?

Fri Sep 27, 2019 9:01 am

RaTTuS wrote:
Fri Sep 27, 2019 8:59 am
crontal -l
will show you the contents
suydo crontab -l
will show the root crontab

have you put it in another one ?
Yes I know,
when I do crontab -l is empty and I don't know the cause of why it has disappeared

Thanks!

pcmanbob
Posts: 7255
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: crontab empy why?

Fri Sep 27, 2019 9:29 am

When you used crontab -e to enter the line did you save the file with Ctrl O and then Ctrl X to exit the editor ( assuming nano used )
and did cron respond with installing new cron

When you say the line disappears is this after a reboot ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: crontab empy why?

Fri Sep 27, 2019 9:58 am

has your sdcard gone read only?

i.e. ls -l >poo
reboot
is file poo still there ?

[poo is Potentially Over-writable Object if you're interested]
Last edited by RaTTuS on Fri Sep 27, 2019 11:45 am, edited 1 time in total.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

pcmanbob
Posts: 7255
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: crontab empy why?

Fri Sep 27, 2019 11:44 am

RaTTuS wrote:
Fri Sep 27, 2019 9:58 am
has your sdcard gone write only
that should be read only :D
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: crontab empy why?

Fri Sep 27, 2019 11:45 am

pcmanbob wrote:
Fri Sep 27, 2019 11:44 am
...
that should be read only :D
fixed ;-9
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 36540
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: crontab empy why?

Fri Sep 27, 2019 1:02 pm

Take a look at /var/spool/cron/crontabs that's where they get stored.

Code: Select all

[email protected]:/var/spool/cron/crontabs# ls -la
total 16
drwx-wx--T 2 root   crontab 4096 Aug 30 10:53 .
drwxr-xr-x 3 root   root    4096 Jul  6 12:38 ..
-rw------- 1 dougie crontab   67 Aug 30 10:53 dougie
-rw------- 1 root   crontab  264 Aug 27 22:57 root
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Raspbian”