Cronjob in LuckyBackup is not working.
It was working until I have changed an hour of daily schedule. It was working when I upgraded from Leap 42.3 to Leap 15.
Cron in services manager is switched on and active.
I removed my default schedule and I created new one but it didn’t work.
What can I do?
krzysiek@linux-gfpk:~> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Thu Jun 28 05:59:48 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Thu Jun 28 05:57:39 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Thu Jun 28 05:49:58 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 19:59:06 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 19:41:37 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 19:40:34 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 19:28:21 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 19:11:12 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 18:40:46 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 18:40:40 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 18:38:34 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 18:27:37 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Wed Jun 27 18:27:03 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Thu Jun 7 10:40:59 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Sat Jan 13 11:21:35 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Sat Jan 13 11:19:08 2018)
# (Cronie version 4.2)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 17 * * * env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/krzysiek/.luckyBackup/profiles/default.profile > /home/krzysiek/.luckyBackup/logs/default-LastCronLog.log 2>&1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ end of luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
krzysiek@linux-gfpk:~>
cat /etc/crontab
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root
#
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
#
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
It was working about 3-4 days ago.
Then Luckybackup stopped doing its schedule.
I did cron schedule on 13 of January, then upgraded system from 42.3 to 15.0 , then added one folder to backup on 7th of June. It was working ok until it stopped few days ago.
Then I tried to change an hour of schedule but it didn’t work.
I reinstaled LuckyBackup but it did not work.
I tried to use snapshot form 13 of June but it did not repair LuckyBackup.
I can only backup files manually now. Schedule do not work.
Thanks for posting. It seems that the LuckyBackup cron entry is in the personal crontab of user
krzysiek.
I am not a LuckyBackup user, thus I have no idea if that is correct (I only asked you to post the crontabs because you had only some story telling without any information going with it).
Thus when the user himself is the one to run that application that is allright. But when making backups should be done on the system level it must be run by root of course.
Also the crontab looks very strange. The first three line are repeted manyfold. They should be there only once. Thus one can aks the question: how is this mess possible?
Also, like said above, the only correct way to make changes to ones crontab is using
crontab -e
Although, I assume that some other tools can do it correct also, but in any case NOT by using some editor directly.
krzysiek@linux-gfpk:~> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/tmpnt10s2sx installed on Thu Jun 28 14:36:36 2018)
# (Cronie version 4.2)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/krzysiek/.luckyBackup/schedule/luckyCron.txt installed on Thu Jun 28 14:19:47 2018)
# (Cronie version 4.2)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 14 * * * env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/krzysiek/.luckyBackup/profiles/default.profile > /home/krzysiek/.luckyBackup/logs/default-LastCronLog.log 2>&1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ end of luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Back In Time system entry, this will be edited by the gui:
0 15 * * * /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime backup-job >/dev/null
Unfortunately LuckyBackup is still not doing backups with schedule. I think that this is LuckyBackup’s problem with cron.
I tried to backup my files with Back In Time with schedule.
Back In Time works fine. Cron works. Schedule works.
I also see that the environment variable DISPLAY is set to :0. That is normaly done to tell a program on which display to create it’s windows.
Now it could be that this is not a GUI program at all, but then why setting DISPLAY?
When it is a GUI program, this will not work. First because this is started by cron in the background it is not even sure that there is a GUI session at all. And when there is a GUI session, it is not given that user krzysiek is owning that session. And even when user krzysiek is running a GUI session on display :0, it is not sure that he allows windows to be opened on his session from outside. All very tricky and a bit strange to me.
I believe it has to do with you trying to make luckyBackup display the system tray icon and it is failing before luckyBackup even runs. So, you get no logs.
It looks like you are creating the cron job from the luckyBackup interface. If that is true then for now check the box that says: Console mode
I found that in the schedule section right below this one in the manual:
If that fixes it then we have eliminated it being a cron issue.
I have to run to an appointment but I will leave a puzzle for others who maybe able to then give you the correct answer. Otherwise I will have to work on this when I get back:
The puzzle:
Assume the time is 8:55 AM and echo $DISPLAY returns :0
If I enter this crontab entry in my logged on user’s crontab:
0 9 * * * DISPLAY=:0 /usr/bin/konsole
FYI this does not work either:
0 9 * * * export DISPLAY=-:0 && /usr/bin/konsole
Then at 9 AM a konsole should display on my desktop. Running jounalctl -f and you will see the error.
I really don’t know if this is an X, KDE, or Plasme requirement, but you need 4 things:
IPv6 must be enabled. A GUI in a cron must connect to the DBUS, and it seems to do it over IPv6. Since you are running this as yourself luckily crom knows where the DBUS is. If you want to know then:
echo $DBUS_SESSION_BUS_ADDRESS
The cron must know where your Xauthority key is. Since this is the key to coneecting to your display (e.g. password) cron does not have that variable set. You can find it by:
echo $XAUTHORITY
Finally cron must know what your DISPLAY is. Again, you find this by:
echo $DISPLAY
Assuming you have all of that your crontab should look something like this:
You can ignore this last part, but for completeness if someone wants to run a GUI as root and display it to another user then the syntax is something like is (I have not tested this, but it would get someone started):