Newbie's problems understanding how Cron works

Re: Newbie's problems understanding how Cron works

Postby Fuddyduddy » Thu Sep 11, 2014 9:49 am

Jocko

Here it is
Code: Select all
login as: root
root@192.168.11.5's password:
root@fvdwsl-base:/ # ls -al '/share/1000/cronjobs/Rsync_USB-NAS_backup_1.from.Recorded_TV_1GgLc7.ph
p'
ls: /share/1000/cronjobs/Rsync_USB-NAS_backup_1.from.Recorded_TV_1GgLc7.php: No such file or directory
root@fvdwsl-base:/ # /usr/bin/php '/share/1000/cronjobs/Rsync_USB-NAS_backup_1.from.Recorded_TV_1Gg
Lc7.php'
Could not open input file: /share/1000/cronjobs/Rsync_USB-NAS_backup_1.from.Recorded_TV_1GgLc7.php
root@fvdwsl-base:/ #
Fuddyduddy
Donator VIP
Donator VIP
 
Posts: 162
Joined: Thu Mar 14, 2013 9:00 am
Location: Åland Islands

Re: Newbie's problems understanding how Cron works

Postby Jocko » Thu Sep 11, 2014 10:20 am

So the job can not run because the custom php script is missing :pound or maybe you make other job tests and now this php no longer exists in cronjobs share !

Still in a putty window, do
Code: Select all
ls -al /share/1000/cronjobs
and see if the php script name of your cron job line is present in the ls output
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Newbie's problems understanding how Cron works

Postby Fuddyduddy » Thu Sep 11, 2014 10:59 am

Yes it is.
Fuddyduddy
Donator VIP
Donator VIP
 
Posts: 162
Joined: Thu Mar 14, 2013 9:00 am
Location: Åland Islands

Re: Newbie's problems understanding how Cron works

Postby Jocko » Thu Sep 11, 2014 11:53 am

So if the php backup script is present, try to do in a Putty windows
Code: Select all
/usr/bin/php -e '/share/1000/cronjobs/yourscriptname.php'
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Newbie's problems understanding how Cron works

Postby Fuddyduddy » Thu Sep 11, 2014 12:16 pm

Jocko wrote:So if the php backup script is present, try to do in a Putty windows
Code: Select all
/usr/bin/php -e '/share/1000/cronjobs/yourscriptname.php'
No response.
Fuddyduddy
Donator VIP
Donator VIP
 
Posts: 162
Joined: Thu Mar 14, 2013 9:00 am
Location: Åland Islands

Re: Newbie's problems understanding how Cron works

Postby Jocko » Thu Sep 11, 2014 12:35 pm

:crazy

You write "Yes it is." so I assume that you answered to my previous ask and so you find a php file with name equal to this one use bey your cron lob line :shocked
so if you have
Code: Select all
0 16 */3 * * /usr/bin/php '/share/1000/cronjobs/trucmuche.php' >>/share/1000/cronjobs/cron.log

you must find in cronjobs folder, a file "trucmuche.php".

Currently, I can say that Rsync_USB-NAS_backup_1.from.Recorded_TV_lGgLc7.php doesn't exist in cronjobs folder
Code: Select all
ls: /share/1000/cronjobs/Rsync_USB-NAS_backup_1.from.Recorded_TV_1GgLc7.php: No such file or directory


So recheck your cron job line to identify the php filename used (<=> trucmuche) and see if it is present in cronjobs folder

if yes, do the command
Code: Select all
 /usr/bin/php -e '/share/1000/cronjobs/yourscriptname.php'
where yourscriptname is the php filename used by cron job line and really present in cronjobs folder (<=> trucmuche)
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Newbie's problems understanding how Cron works

Postby Fuddyduddy » Thu Sep 11, 2014 2:04 pm

OK

I've now identified what was causing the previous, rubbish, result. It was our old friend "l" (lower-case of "L"), being virtually indistinguishable from numeral "1". The alphanumeric code was "lGgLc7", which I read as "1GgLc7"

I reasoned that, since there was an occurrence of letter "L" in the sequence that was capitalised, the probability must be that this character must be numeral "1" not lower-case "L". To my mind it's utterly crazy for lower-case "L" to be used at all except where it's impossible to confuse with "1" - which certainly isn't so in this example. But, there it is...

Here's the PuTTY output now
Code: Select all
login as: root
root@192.168.11.5's password:
root@fvdwsl-base:/ # ls -al /share/1000/cronjobs
total 104
drwxrwxrwx   2 root   root   57344 2014-09-11 10:34 .
drwxrwxrwx  10 root   root    4096 2014-09-10 10:02 ..
-rw-rw-rw-   1 root   root     132 2014-09-10 12:55 active_jobs.cron
-rw-r--r--   1 root   root     599 2014-09-09 12:12 cron.log
-rw-rw-rw-   1 root   root     599 2014-09-09 12:12 My_Movies_2014-09-09_12-00-02.log
-rw-rw-rw-   1 nobody nobody    60 2014-09-10 12:52 Recorded_TV_exclude.txt
-rw-------   1 root   root     132 2014-09-11 10:34 root
-rw-rw-rw-   1 nobody nobody  2854 2014-09-08 16:32 Rsync_USB-NAS_backup_1.from.My_Movies_LpwTzI.php
-rw-rw-rw-   1 nobody nobody  2854 2014-09-08 16:39 Rsync_USB-NAS_backup_1.from.My_Movies_oTF7Ht.php
-rw-rw-rw-   1 nobody nobody  2854 2014-09-09 09:21 Rsync_USB-NAS_backup_1.from.My_Movies_ZErzJF.php
-rw-rw-rw-   1 nobody nobody  2961 2014-09-10 10:11 Rsync_USB-NAS_backup_1.from.Recorded_TV_I5LTyA.php
-rw-rw-rw-   1 nobody nobody  2961 2014-09-10 12:52 Rsync_USB-NAS_backup_1.from.Recorded_TV_lGgLc7.php
root@fvdwsl-base:/ # /usr/bin/php -e '/share/1000/cronjobs/Rsync_USB-NAS_backup_
1.from.Recorded_TV_lGgLc7.php'
crond: USER root pid 2036 Rsync script started at : 2014-09-11_14:42:59
crond: USER root pid 2036 USB share is available
crond: USER root pid 2036 rsync command:
umask 0 && /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -tDvr --delete-excluded --exclude-from='/share/1000/cronjobs/Recorded_TV_exclude.txt' '/share/1000/Recorded_TV/' '/share/1000/NAS_backup_1/Back-up Recorded_TV'> '/share/1000/cronjobs/Recorded_TV_2014-09-11_14-42-59.log' 2>&1
What is this telling us please?
Fuddyduddy
Donator VIP
Donator VIP
 
Posts: 162
Joined: Thu Mar 14, 2013 9:00 am
Location: Åland Islands

Re: Newbie's problems understanding how Cron works

Postby Jocko » Thu Sep 11, 2014 2:29 pm

Strange, because after the line (umask 0 && /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -tDvr --delete-excluded --exclude-from='/share/1000/cronjobs/Recorded_TV_exclude.txt' '/share/1000/Recorded_TV/' '/share/1000/NAS_backup_1/Back-up Recorded_TV'> '/share/1000/cronjobs/Recorded_TV_2014-09-11_14-42-59.log' 2>&1) where the rsync command is put in background, you should see another line like
Code: Select all
crond: USER root pid 2036 Rsync script stopped at : 2014-09-11_14:xx:xx

if you didn't close yet your putty window (otherwise the rsync command is aborted) you should see it in the output
Code: Select all
ps axf


---edit---
I also go to check the script built by the backup menu when you use an USB disk as destination (I assume that you use version 15.3)
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Newbie's problems understanding how Cron works

Postby Fuddyduddy » Thu Sep 11, 2014 4:03 pm

Jocko wrote:if you didn't close yet your putty window (otherwise the rsync command is aborted) you should see it in the output
Code: Select all
ps axf
Nope, it isn't there
---edit---
I also go to check the script built by the backup menu when you use an USB disk as destination (I assume that you use version 15.3)
Yes I do.
Fuddyduddy
Donator VIP
Donator VIP
 
Posts: 162
Joined: Thu Mar 14, 2013 9:00 am
Location: Åland Islands

Re: Newbie's problems understanding how Cron works

Postby Jocko » Thu Sep 11, 2014 5:01 pm

So I checked the backup menu and the USB script to make the backup.

I found no errors.
If I run it manually I get as output in a shell terminal
Code: Select all
23
root@Shaula:/ # php -e /share/1000/cronjobs/Rsync_USB-STOCKAGE_5.from.cronjobs_2T7ERN.php
crond: USER root pid 2555 Rsync script started at : 2014-09-11_16:46:06
crond: USER root pid 2555 USB share is available
crond: USER root pid 2555 rsync command:
umask 0 && /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -tDvr --delete '/share/1000/fvdw/searches' '/share/1000/STOCKAGE_5/essai2'> '/share/1000/cronjobs/searches_2014-09-11_16-46-06.log' 2>&1
crond: USER root pid 2555 Rsync command successful
crond: USER root pid 2555 Rsync script ended at : 2014-09-11_16:46:07
0
( => compare with your output)
The related job is also run at the scheduled date-time.

But maybe I found an explanation. If your USB is a FAT32 or NTFS disk, then if there are some filename to backup with unauthorized characters (<>/?*:!"|) then the backup fails.

In this case the output is
Code: Select all
root@Shaula:/ # php -e /share/1000/cronjobs/Rsync_USB-STOCKAGE_5.from.cronjobs_2T7ERN.php
crond: USER root pid 2464 Rsync script started at : 2014-09-11_16:42:37
crond: USER root pid 2464 USB share is available
crond: USER root pid 2464 rsync command:
umask 0 && /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -tDvr --delete '/share/1000/fvdw/searches' '/share/1000/STOCKAGE_5/essai2'> '/share/1000/cronjobs/searches_2014-09-11_16-42-37.log' 2>&1
crond: USER root pid 2464 Rsync command returned some errors: see the log file (/share/1000/cronjobs/searches_2014-09-11_16-42-37.log)!
23
crond: USER root pid 2464 Rsync script ended at : 2014-09-11_16:43:05


and in searches_2014-09-11_16-42-37.log, I read this
Code: Select all
rsync: mkstemp "/share/1000/STOCKAGE_5/essai2/searches/.SDF.passwd-kappa:jocko.ClbmpO" failed: Invalid argument (22)


But note that the output is still not the same than yours

So check your source folder.
search some error lines in the file cron.log
and also in Recorded_TV_xx-yy-zz_aa-bb-cc.log
(these two last files are available in /share/1000/cronjobs)
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

PreviousNext

Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 8 guests