Problems with Cronjobs in joomla 3.x | Joomla Support | Forum Archive

The free forums are no longer in use. It remains available as read-only archive.

Avatar
Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
The forums are currently locked and only available for read only access
sp_TopicIcon
Problems with Cronjobs in joomla 3.x
September 22, 2014
11:28 am
Avatar
cr0xfyre
Member
Members
Forum Posts: 7
Member Since:
September 22, 2014
sp_UserOfflineSmall Offline

Hi everyone!

I'm having problems using the XCloner auto backup via cron feature, when using XCloner 3.5.1 with joomla 3.x. I hope someone can help me…

Here is the situation so far:

My current webhost provides a task scheduling funcion and I have configured the cronjob there. This is all configured by means of form filling, but in the end the command being executed is has follows: /usr/local/bin/php.ORIG.5_4 -c /usr/local/lib/php.ini-2 /homez.401/sysreseajm/www/xxxx/administrator/components/com_xcloner-backupandrestore/cloner.cron.php

 

At first, running this script was giving me the "To run this script you need to create a custom config file inside XCloner config (…)" error, but I've read somewhere in the forums that this could be solved by deleting the following lines from the cloner.cron.php:

if(!isset($argv[1]) ) {

echo "<h2>".$topErrorLine1."</h2>n";

echo "<strong>".$topErrorLine2."</strong>n";

exit;

}

Now here comes the weird part. By doing this i can get the cron to run IF I call it from the browser (using the cloner.cron.php address, ouch security :S), but it creates numerous backups instead of only one. But the worst is that, when called from my host's task scheduler, I now get another error, which I have no clue how to solve:

Your backup directory /home/sysreseajm/www/xxxx/administrator/backups is not writeable or does not exists!

Which is weird because I know from running in the browser, that the folder is indeed writable :S

 

Can someone help me with this? I'll gladly provide more details if necessary…

September 22, 2014
12:35 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

To properly run the cronjob you need to save a custom cron config, check the XCloner Config->Cron tab, then use that name within your cron command as

 

/usr/local/bin/php.ORIG.5_4 -c /usr/local/lib/php.ini-2 /homez.401/sysreseajm/www/xxxx/administrator/components/com_xcloner-backupandrestore/cloner.cron.php my_custom_name.php 

 

Once that is done, make sure the  /home/sysreseajm/www/xxxx/administrator/backups folder has 777 permissions.

 

Hope it helps.

September 22, 2014
1:08 pm
Avatar
cr0xfyre
Member
Members
Forum Posts: 7
Member Since:
September 22, 2014
sp_UserOfflineSmall Offline

Thanks for the reply!

I was trying to implement your solution, but I've come across another problem. My host's (OVH) task scheduler doesn't allow white spaces in the script path, so I can't add the "(...)/cloner.cron.php my_custom_name.php" at the end.

Do you know of any other way to do this?

September 23, 2014
7:44 am
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

You would need to modify the cloner.cron.php script manually to take that name some other way, best to check with them what are your options for sending arguments to the php script.

September 23, 2014
4:01 pm
Avatar
cr0xfyre
Member
Members
Forum Posts: 7
Member Since:
September 22, 2014
sp_UserOfflineSmall Offline

OK, I've hardcoded the config name in the script and can now run it. I'm back to square one with the error:

Your backup directory /home/sysreseajm/www/xxxx/administrator/backups is not writeable or does not exists!

I've chmod'ed the folder to 777 and double checked the premissions, but to no avail!

Also I noticed the script also sends a PHP warning:

PHP Warning:  filesize(): stat failed for /home/sysreseajm/www/xxxx/administrator/backups/ in /homez.401/sysreseajm/www/home/administrator/components/com_xcloner-backupandrestore/cloner.cron.php on line 186

Do you have any ideia how to solve this?

 

EDIT: Fyi in my modified script, line 186 is "$bsize = getFileSizeText(filesize($source_file));"

September 24, 2014
6:13 am
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

The second error is probably related to the first one as it seems XCloner is unable to write to that backup folder.

 

Ovidiu

September 24, 2014
6:50 pm
Avatar
cr0xfyre
Member
Members
Forum Posts: 7
Member Since:
September 22, 2014
sp_UserOfflineSmall Offline

I don't understand… the path checks are all OK in the XCloner Manager! arggggg

I think I'll just setup an online cron scheduler and call the URL… which shouldn't work right? but apparently it does… Cry

September 26, 2014
5:02 pm
Avatar
cr0xfyre
Member
Members
Forum Posts: 7
Member Since:
September 22, 2014
sp_UserOfflineSmall Offline

I finally figured it out!

Thank you for your answers Ovidiu, the problem was really on the side of my host. And well… was kinda dumb Smile

So I'll leave here the solution in case anyone else is using OVH as a provider and has the same problem.

As I said the path,

/home/sysreseajm/www/xxxx/administrator/backups

is said to be OK in the XCloner Manager, but when the cron job executes from the OVH task manager, they execute it from the starting folder "homez.401" (like you can see in my first post).

So I wondered and changed the folder in the XCloner manager, and voilá, the path

/homez.401/sysreseajm/www/xxxx/administrator/backups

is not only ALSO OK to the XCloner manager, but now everything goes fine when the cron job execute from the OVH task manager! Hurray!

 

Thanks again for the support Ovidiu, and thanks even more for making such an awesome plugin!

April 19, 2015
12:32 pm
Avatar
Pablo
New Member
Members
Forum Posts: 2
Member Since:
April 19, 2015
sp_UserOfflineSmall Offline

Hi cr0xfyre,

how you hardcoded the config name in the script?

 

I've been dealing with the same problem since 2 days now...

I also changed the backup location adding OVH's naming... 

Thanks for sharing the solution!!! 🙂

 

I just don't know how to hardcode the config name in the .php to call my custom cron...

 

Thanks!

April 21, 2015
2:39 pm
Avatar
cr0xfyre
Member
Members
Forum Posts: 7
Member Since:
September 22, 2014
sp_UserOfflineSmall Offline

Hi Pablo,

I believe I ended up using the main config instead of a custom one. For that I only had to comment the following lines in the cloner.cron.php (they're right at the beginning):

 

if(!isset($argv[1]) ) {
echo  "<h2>".$topErrorLine1."</h2>\n";
echo "<strong>".$topErrorLine2."</strong>\n";
exit;
}
But if you want to hardcode your custom config, it's also possible.
I believe you can just add a line like this
$_REQUEST['config'] = "my_custom_name.php";

just before (or in place of) this block of code (should be around line 40-50):
if($_REQUEST['config'] == ""){
if($argv[1] != ""){
$_REQUEST['config'] = $argv[1];
}
}

I believe that should be enough, but I can't really test it right now, so let me know how it goes!
Cheers,
cr0xfyre
Forum Timezone: America/Chicago
Most Users Ever Online: 867
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
mlguru: 30
Django29: 29
Andy: 21
D: 21
Marcus: 20
Jamie F: 19
Member Stats:
Guest Posters: 737
Members: 9462
Moderators: 2
Admins: 3
Forum Stats:
Groups: 3
Forums: 7
Topics: 2397
Posts: 8236
Newest Members:
Robert Dumitru
Moderators: TriP: 0, Steve Burge: 0
Administrators: Ovidiu Liuta: 2484, Victor Drover: 1, Valentin Barbu: 0