hi,
may anyone is using directadmin, and has successfully cronjobs setuped?
I tried all ways:
/domains/example.com/public_html/scripts/; /usr/local/bin/php -f fetch.php @ALL
and
/usr/local/bin/php /domains/example.com/public_html/scripts/fetch.php @ALL
and
/usr/local/bin/php fetch.php @ALL
and
cd /usr/local/bin/curl --silent --compressed /domains/example.com/public_html/scripts/fetch.php @ALL)
But script is not initiated.. I see in log that cron was initiated, but I guess that I am using wrong command :/
Thank you, now this one works fine:
cd /home/admin/domains/example.com/public_html/scripts;/usr/local/bin/php fetch.php @ALL
But this one doesnt work:
cd /home/admin/domains/example.com/public_html/scripts;/usr/local/bin/php import_slow.php @MODIFIED
cron.php idea is great, but it is not good for big sites. Problem is that it clear the database before import, and site is empty for hour until feeds are re-imported.
I think it would be great to start to fink about update.php, but not re-import :)
Could you please help me to automate import_slow.php with cron?
K.
Hi karolis,
Because of the way import_slow.php works, it has to be requested using an HTTP method; which from the command line (cron) would require wget or curl - have a go with the following as the command:
/usr/bin/wget -t 0 -O /dev/null http://www.example.com/scripts/import_slow.php?filename=@MODIFIED
(all on one line of course)
However some versions of wget require --max-redirect=9999 instead of -t 0 so if the above only makes one request rather than following import_slow.php's redirects, try:
/usr/bin/wget --max-redirect=9999 -O
/dev/null http://www.example.com/scripts/import_slow.php?filename=@MODIFIED
Cheers,
David.
--
PriceTapestry.com
Tried in this way, cron is initiated but import was not started...
/usr/bin/wget -t 0 -O /dev/null http://www.example.com/scripts/import_slow.php?filename=@MODIFIED&password=mypassword
Hi karolis,
That's almost certainly then because wget is not present in /usr/bin/. I notice from your original post that you had tried a curl verison; and curl will work fine provided that the -L parameter is used which instructs curl to follow HTTP redirection. Based on the path to curl from your original post; the following should work:
/usr/local/bin/curl -L -o /dev/null "http://www.example.com/scripts/import_slow.php?filename=@MODIFIED&password=mypassword"
Note that I've added "quotation marks" around the URL - this is important in command lines containing URLs as & will have a special meaning otherwise - I should have spotted this before and may be the only reason that the wget version isn't quite working so you might like to try that before moving to the CURL version...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi David,
This command starts cron job, but it does not goes sucessfully till the end.
It imports some products and stops. No dates in column "Imported" are updated. What is more, I see that pruducts were deleted before import, and imported just some of them.
If I run IMPORT ALL through admin panel, import goes successfully.
Could you please help me to solve this?
Thanks,
K.
Hello Karolis,
I've just checked the cURL documentation and it looks like the maximum number of re-directs followed when using -L is 50, which may not be sufficient however it can be set to unlimited using the --max-redirs parameter with a value of -1, so have a go with:
/usr/local/bin/curl -L --max-redirs -1 -o /dev/null "http://www.example.com/scripts/import_slow.php?filename=@MODIFIED&password=mypassword"
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Thank you a lot, will test this tonight and come back with my results.
Regards,
K.
Hi,
I tried your last advice, but unlucky. Cron Job wasn't started at all.
Do you have another idea, how to initiate Slow Import ?
Regards,
K.
Hi K,
-1 doesn't seem to be working as expected as a value for --max-redirs however it works OK using an arbitrarily large number - have a go with:
/usr/local/bin/curl -L --max-redirs 9999 -o /dev/null "http://www.example.com/scripts/import_slow.php?filename=@MODIFIED&password=mypassword"
...which should do the trick...
Cheers,
David.
--
PriceTapestry.com
Thanks a lot. Will try and come back with my results.
Hi Karolis,
The first option is almost correct but is missing the cd command from the front - have a go with;
cd /domains/example.com/public_html/scripts/; /usr/local/bin/php -f fetch.php @ALL
However, I wonder if it is missing /home/username from the front where username is your username on the system - have a go with:
cd /home/username/domains/example.com/public_html/scripts/; /usr/local/bin/php -f fetch.php @ALL
As well as /username/ don't forget to replace example.com with your domain name also. Finally; note that cron.php in palce of fetch.php @ALL will fetch all automation tool jobs and then import all in one go...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com