LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2015, 07:56 AM   #1
NFI
LQ Newbie
 
Registered: Jun 2009
Posts: 13

Rep: Reputation: 0
Possible Cron issue? If so where am I going wrong?


My handle is NFI, and not by accident as far as Linux issues are concerned. I've been programming/working etc with DOS/Windows for almost 30 years as an IT professional. But Linux, who I've up til now had VERY limited exposure to, has passed me by largely. Until now.

I'm doing my best to read manuals, posts on forums such as this and others, but I still cannot get cron jobs to work, and it has me buggered as to why.

OS is Linux Ubuntu 14.04 LTS 64 Bit Server. All system updates and program updates have been/are installed. Running Gnome GUI.

I would imagine the answer will be quite simple to someone more used to the system than I.

I'm trying to backup a folder homes/david/desktop/Server to an external USB drive mounted in the /david/media folder

Try as I might, no backup program will work when cronned. Run it manually, it's fine. But once scheduled none work. So far I've tried Rsych, Deju Dup, Lucky Backup, Simple Backup, GRsynch and probably others I've forgotten.

I'm logged in as david with his password which has basically root priveledges without being root. Administrator privileges in "Windows" speak.

Please, what am I missing?
 
Old 06-17-2015, 08:02 AM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 98
Can you provide the output of your crontab?

Code:
crontab -l
 
Old 06-17-2015, 08:48 AM   #3
NFI
LQ Newbie
 
Registered: Jun 2009
Posts: 13

Original Poster
Rep: Reputation: 0
root@Server:/home/david# crontab -l

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47 10 * * * env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/david/.luckyBackup/profiles/default.profile > /home/david/.luckyBackup/logs/default-LastCronLog.log 2>&1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ end of luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
root@Server:/home/david#

---------- Post added 06-17-15 at 10:49 PM ----------

david@Server:~$ crontab -l

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47 10 * * * env DISPLAY=:0 /usr/bin/luckybackup --silent --skip-critical /home/david/.luckyBackup/profiles/default.profile > /home/david/.luckyBackup/logs/default-LastCronLog.log 2>&1
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ end of luckybackup entries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
david@Server:~$
 
Old 06-17-2015, 08:56 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
What is in the file /home/david/.luckyBackup/logs/default-LastCronLog.log

BTW, are you logged in at 10:47 when this thing tries to run?

Last edited by jpollard; 06-17-2015 at 09:04 AM.
 
Old 06-17-2015, 10:47 AM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
cron really isn't built for GUI applications, you should switch to a command line utility and remove that DISPLAY setting in your job. "rsync" is what 99.999% of people use for this type of task, I highly suggest using that instead (you mentioned rsynch, was that a typo? I've never heard of it).

Why are you trying to run the same job as two different users at the exact same time? That's going to lead to conflicts. Pick one.

There is no such thing as a regular user with root privileges in Linux. You can have sudo privileges, but that's different. The main difference is it requires your password to be entered, which means it can't be automated, unless you modify the sudoers entry to allow you to run that exact command without requiring a password.

As jpollard said, you're dumping the output of your command to a log file, so what is in the log file???
 
Old 06-17-2015, 11:12 AM   #6
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 98
Forgive me, because I am not familiar with the program you are using, but are your crontab entries generated by luckybackup? One of the "how-to" pictures displays a CRON-IT button, so I assume it generates the cron job and adds it to the crontab. I ask because I cannot think of a reason to 'need' your Display set to do a basic file copy. Looking at the luckybackup website, it appears you have the ability to create jobs in cron that would not require X capabilities (last 2 entries in the picture) by using simple command line syntax.
http://luckybackup.sourceforge.net/d...Line_usage.png
 
Old 06-17-2015, 01:31 PM   #7
hat1208
LQ Newbie
 
Registered: Jul 2013
Posts: 16

Rep: Reputation: Disabled
Also when executing from the command line you are logged in with your user credentials and your profile has been processed. When you execute a crontab you are not logged in and your profile has not been processed. So you could have PATH issues or other execution issues because of not being logged in when the crontab is executed.
 
Old 06-17-2015, 06:47 PM   #8
NFI
LQ Newbie
 
Registered: Jun 2009
Posts: 13

Original Poster
Rep: Reputation: 0
OK, thanks for the input. First, Rsynch is indeed a typo and was meant to be rsync. Yes, I was logged in at the time of 10:47 hoping to watch the cron job work, or at least if it failed see why.

heres's the contents of /home/david/.luckyBackup/logs/default-LastCronLog.log

I know WHY the seagate one failed, it wasn't connected, and that was intentional as the two backup drives (Backup and Seagate) are used alternatively on a daily basis so one will always fail.

============================================================================================
Task list check
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


* Checking if the task list is empty... done
* Checking if 2 connected tasks have been selected for execution... done
* Checking if no task is included... done
* Checking if 2 or more identical destination directories are declared
& 'Backup dir contents' is checked... done


** Task list looks ok... **

============================================================================================
Directories check
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source & destination data check results
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Errors have been found
Please have a good look at the following messages

WARNING means that the task is NOT going to be performed
CRITICAL means that the task is going to be performed normally

If a directory is empty or does not exist,
there is a possibility that you 've forgotten to mount a partition/drive
or have just mistyped a path !!

BEWARE if a destination is empty or non-existent
and it is not the first time you perform the specific task(s)

Also have in mind that checks are not performed for remote data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[Ok] -> Server Backup - BackUp
Last execution time : Friday, 12 June 2015 11:18:53 AM AEDT (no errors)
Source directory : /home/david/Desktop/Server/
Destination directory : /media/david/Backup/
_____________________________________________________________________________________________
[WARNING] -> Server BackUp - seagate
Last execution time : not available
Source directory : /home/david/Desktop/Server/
Destination directory : /media/david/Seagate Backup Plus Drive/ is not mounted.

This task will be SKIPPED

_____________________________________________________________________________________________
 
Old 06-18-2015, 09:01 AM   #9
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 98
Was this ran manually, rather than from the cron job (since it appears to have been successful)? If so, do you have a copy of a log that failed via cron?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron running as wrong user rucknrun Linux - Server 4 03-19-2015 11:23 AM
cron issue props666999 Debian 1 08-31-2007 12:35 PM
What am I doing wrong with cron? xxx_Birdman_xxx Linux - General 6 12-22-2004 01:07 PM
cron.daily runs at the wrong time dwz3591 Linux - Software 2 10-27-2004 10:46 AM
What is Wrong with my CRON? Rv5 Programming 3 09-13-2004 02:28 AM


All times are GMT -5. The time now is 06:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration