CodeIgniter Forums
CRON job to a controller? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: CRON job to a controller? (/showthread.php?tid=8888)



CRON job to a controller? - El Forum - 06-04-2008

[eluser]mck9235[/eluser]
I'm creating an automated backup system for my server that will zip up certain directories and E-mail them to me (might as well make use of that 6 GB from Google!). The backup will run daily, and I decided on using a CRON job. My problem is, how exactly do I do this, as when I normally set up CRONs, it goes to a certain file (outside of my public_html/ too) but with CI it will need to go to a URL.

A search resulted in this thread that recommended using cURL. Is that the best option, or is there another way?

Another thought is security. I don't want some nosy person to uncover the URL used for the backup controller. Maybe I should add a hash to the URL or something?

Thanks for any help


CRON job to a controller? - El Forum - 06-04-2008

[eluser]nmweb[/eluser]
wget with the right url would work as well. You could exclude/include ips from executing the controller with .htaccess or in php.


CRON job to a controller? - El Forum - 06-04-2008

[eluser]Sean Murphy[/eluser]
I strongly recommend the method outlined in this wiki page http://codeigniter.com/wiki/Category:Advanced::CronScript/


CRON job to a controller? - El Forum - 06-06-2008

[eluser]mck9235[/eluser]
Thanks for all the replies -- I think I'm going to follow the way recommended in the Wiki!