Cron Task URL Access


5 posts
by Darth » Mon May 13, 2013 6:01 pm
Hi All

I'm trying to use a cron task to auto-reboot my IP Camera (Foscam FI9802W) every 24 hours, current firmware is poor and FTP/NAS access lock up on a regular basis if not rebooted.

If I use the following URL in Midori my Camera will reboot:

http://192.168.1.20:88/cgi-bin/CGIProxy ... x&pwd=xxxx

So, I thought why not generate a Cron Task (crontab -e) to automate the process, after a bit of research I've come up with the following but for the life of me I cannot get it to work; anyone any suggestions to why and how to solve it:

59 23 * * * user/bin/wget -O - -q -t 1 http://192.168.1.20:88/cgi-bin/CGIProxy ... x&pwd=xxxx

Please be gentle, I'm fairly new to Linux.
Posts: 21
Joined: Sat Aug 04, 2012 10:18 am
Location: Wisbech
by rpdom » Mon May 13, 2013 6:22 pm
Darth wrote:user/bin/wget


That should be /usr/bin/wget
Posts: 3424
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by Darth » Mon May 13, 2013 7:08 pm
rpdom

Many thanks for getting back to me so quickly, yep my syntax was poor but I've just tried the following command:

02 20 * * * /usr/bin/wget -O - -q -t 1 http://192.168.1.20:88/cgi-bin/CGIProxy ... x&pwd=xxxx

And it also did not work, any other suggestions greatly welcomed.
Posts: 21
Joined: Sat Aug 04, 2012 10:18 am
Location: Wisbech
by richardp » Mon May 13, 2013 7:19 pm
Darth wrote:rpdom

Many thanks for getting back to me so quickly, yep my syntax was poor but I've just tried the following command:

02 20 * * * /usr/bin/wget -O - -q -t 1 http://192.168.1.20:88/cgi-bin/CGIProxy ... x&pwd=xxxx

And it also did not work, any other suggestions greatly welcomed.



1) Place the http://xxxxxxxxxxxxxxxxxxxxxxxx&xxx&xxx part in double quotes (") - the & might be being interpreted as the 'Background task'

2) Try making a script and putting it in /usr/bin

Code: Select all
#!/bin/sh
/usr/bin/wget -O - -q -t 1 http://192.168.1.20:88/cgi-bin/CGIProxy.fcgi?cmd=rebootSystem&usr=xxxx&pwd=xxxx


chmod +x [your script name]

Then you can place your script name in the CRON file to execute. you can also test the script by running it manually to see the output. Again, put the http:// URL in double quotes.

Richard
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by Darth » Mon May 13, 2013 7:24 pm
Richard

Many thanks, the double quotes solved the problem. I just love my little Pi.

Dave
Posts: 21
Joined: Sat Aug 04, 2012 10:18 am
Location: Wisbech