Personal Cron not surviving boot [solved]

Questions about applications and software
Forum rules
Before you post please read how to get help
rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Personal Cron not surviving boot [solved]

Post by rdonnelly » Thu Jan 28, 2016 6:33 pm

I have a cron set to go off at 5 PM to do a backup with Lucky Backup.

Programs creates the crontab, crons it, and it appears in my task scheduler and runs at 5 PM.

Once I reboot, it is not longer in the tasks scheduler and does not run.

I also check var/logs for any cron logs, and none exist.

Any help much appreciated. :?:
Last edited by rdonnelly on Sun Oct 22, 2017 11:13 am, edited 2 times in total.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving root

Post by rdonnelly » Thu Jan 28, 2016 6:49 pm

Let me add, it puts the luckycron.txt in home/.luckybackup maybe it needs to be put on root?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving root

Post by Habitual » Thu Jan 28, 2016 8:12 pm

show us the cron.
If it is a script in a cron, show us the script.

Thanks.

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving root

Post by rdonnelly » Fri Jan 29, 2016 3:27 pm

Code: Select all

env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/bob/.luckyBackup/profiles/Daily.profile > /home/bob/.luckyBackup/logs/Daily-LastCronLog.log 2>&1
BTW, this script did work fine for several years in opensuse, and it does work fine until a reboot wipes it off of personal cron.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving root

Post by Habitual » Fri Jan 29, 2016 3:49 pm

rdonnelly wrote:

Code: Select all

env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/bob/.luckyBackup/profiles/Daily.profile > /home/bob/.luckyBackup/logs/Daily-LastCronLog.log 2>&1
BTW, this script did work fine for several years in opensuse, and it does work fine until a reboot wipes it off of personal cron.
Hmmz. Try this:

Code: Select all

env DISPLAY=:0 ; /usr/bin/luckybackup --silent --skip-critical /home/bob/.luckyBackup/profiles/Daily.profile > /home/bob/.luckyBackup/logs/Daily-LastCronLog.log 2>&1
I added the command separator ;

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving root

Post by rdonnelly » Fri Jan 29, 2016 6:59 pm

Thanks Habitual I tried it, but even a log out makes the cron job disappear.

Also when I tried run now with your edit, it ran but opened a bash window at the same time.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving root

Post by Habitual » Fri Jan 29, 2016 7:43 pm

Tell us more about this cron.
How is the editor being invoked and by whom?

If you stuck all this

Code: Select all

env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/bob/.luckyBackup/profiles/Daily.profile > /home/bob/.luckyBackup/logs/Daily-LastCronLog.log 2>&1
in cron, it is likely not gonna work.

I'd stick that into a script.sh and use the script.sh in the cron.

Script needs minimum 700 permissions and a she-bang to be useful.

Cosmo.
Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: Personal Cron not surviving root

Post by Cosmo. » Sat Jan 30, 2016 6:49 am

Create any other cron-job manually and check, if this survives booting.

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving boot

Post by rdonnelly » Sat Jan 30, 2016 8:51 am

No other personal cron is surviving log out either.

This simple cron to start kate will run, but will not survive log out.

Code: Select all

/usr/bin/kate
Just noticed I made typo on the topic: "Personal Cron not surviving root", root should be boot.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving root

Post by rdonnelly » Sat Jan 30, 2016 9:48 am

Habitual wrote:Tell us more about this cron.
How is the editor being invoked and by whom?

If you stuck all this

Code: Select all

env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/bob/.luckyBackup/profiles/Daily.profile > /home/bob/.luckyBackup/logs/Daily-LastCronLog.log 2>&1
in cron, it is likely not gonna work.

I'd stick that into a script.sh and use the script.sh in the cron.

Script needs minimum 700 permissions and a she-bang to be useful.
Luckybackup makes the cron within the program.
I have a profile called "Daily"
I select schedule.
Put in my time.
Hit okay.
Hit the Cron it button.
Done.

Look in my KDE task scheduler under personal cron and the job appears.
Log out or reboot and the job, or any other personal cron disappears.

I am running this on the user level with no root privileges.
This worked fine in opensuse for a couple of years even with upgrades, makes me wish I kept my opensuse installation to compare it against, I am pretty sure I have the partitions cloned and may do a restore to see what is the difference.

Can some one help me to make a script to accomplish this with system cron?

Thanks for the replies.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving boot

Post by Habitual » Sat Jan 30, 2016 10:19 am

The editor Kate will need a Graphical desktop to "run" before it will successfully execute kate via cron.
Does

Code: Select all

grep cron /var/log/messages
say anything about the problem?

Can you make a new user on the system and login as the new user, run the backup and see if it fires via the
cron feature of LuckyBackup?

Here is a better test of cron:

Code: Select all

* * * * * /bin/echo "hello" >> /tmp/test.log
and check /tmp in a minute, literally for test.log

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving boot

Post by rdonnelly » Sat Jan 30, 2016 1:58 pm

Got this

Code: Select all

grep: /var/log/messages: No such file or directory
Test log was empty even after 3 minutes.

I will have to try making a new user and see how it goes?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving boot

Post by Habitual » Sat Jan 30, 2016 2:33 pm

rdonnelly wrote:Got this

Code: Select all

grep: /var/log/messages: No such file or directory
Test log was empty even after 3 minutes.

I will have to try making a new user and see how it goes?
You could, but I don't hold much Hope for a successful report.

And you installed LB without any additional repos/PPAs?

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving boot

Post by rdonnelly » Sat Jan 30, 2016 3:51 pm

Habitual wrote:
rdonnelly wrote:Got this

Code: Select all

grep: /var/log/messages: No such file or directory
Test log was empty even after 3 minutes.

I will have to try making a new user and see how it goes?
You could, but I don't hold much Hope for a successful report.

And you installed LB without any additional repos/PPAs?
It was installed right from synaptic. But the cron I did for kate did run even with out GK, but it did not survive logout just the same.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving boot

Post by rdonnelly » Sat Jan 30, 2016 4:47 pm

After looking that this site, I checked my var/log/syslog and the very first line says:

Code: Select all

Jan 30 07:17:52 Inspiron-2016 anacron[31398]: Job `cron.daily' terminated
Also if you read this part:
Enable User Level Cron
If the /etc/cron.allow file exists, then users must be listed in it in order to be allowed to run the crontab command. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does, then users must not be listed in the /etc/cron.deny file in order to run crontab.

In the case where neither file exists, the default on current Ubuntu (and Debian, but not some other Linux and UNIX systems) is to allow all users to run jobs with crontab.
Well I have neither entry, so I made a cron.allow file, and logged out, when I logged in, I was denied using Kcron, so I deleted the cron.allow file and my personal cron some how survived that log in?

So it looks like it is killing my personal cron on login?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving boot

Post by Habitual » Sat Jan 30, 2016 7:15 pm

rdonnelly wrote:I was denied using Kcron, so I deleted the cron.allow file and my personal cron some how survived that log in?
You've been using kcron to set this cronjob?
If so, try setting it using the terminal and

Code: Select all

crontab -e

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving boot

Post by rdonnelly » Sat Jan 30, 2016 7:21 pm

BTW here are the links I was speaking of.

https://help.ubuntu.com/community/CronHowto

http://docs.oracle.com/cd/E23824_01/htm ... on-23.html

Here is the output of crontab -e
cron.png
Last edited by rdonnelly on Sat Jan 30, 2016 7:28 pm, edited 1 time in total.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving boot

Post by Habitual » Sat Jan 30, 2016 7:23 pm

Yeah, the oracle link is not worth spit on LM.
It might be 'valid' on an Oracle OS but not LM. :)

rdonnelly
Level 5
Level 5
Posts: 514
Joined: Thu Nov 27, 2008 9:38 pm

Re: Personal Cron not surviving boot

Post by rdonnelly » Sat Jan 30, 2016 7:29 pm

Habitual wrote:Yeah, the oracle link is not worth spit on LM.
It might be 'valid' on an Oracle OS but not LM. :)
Good to know, look above for the output on crontab -e I did an edit.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Personal Cron not surviving boot

Post by Habitual » Sat Jan 30, 2016 7:59 pm

rdonnelly wrote:
Habitual wrote:Yeah, the oracle link is not worth spit on LM.
It might be 'valid' on an Oracle OS but not LM. :)
Good to know, look above for the output on crontab -e I did an edit.
It looks ok to me. Someone else may see something I may have missed.
Generally, when I need an LM reference, I always go to https://help.ubuntu.com/community first.

Thanks Bob, I'm going to relax and chill out away from here for the evening.

Post Reply

Return to “Software & Applications”