And here is my crontab entry:
Code:
0,30 * * * * ~/public_html/pisg-0.52/pisgchek >/dev/null 2>&1
For some reason (that I cannot remember) I have pisg sitting in "pisg-0.52" but that's irrelevant. LOL
Crontab updates my stats page every 30 minutes on the hour. You should be easily able to set up a crontab for FTP with little effort also.
I am after uploading my stats via ftp on the shell to my web servers subdomain as index.html. Not exclusive to that, to also have it upload each 30 mins without the need for me to manually execute the ftp upload.
I have a file called "pisgcheck" and i have a cron set to update the stats in intervals of 30mins, but as-of-right-now, the stats only generate to the folder public_html on the shell, and id like to have the stats on my website preferably.
Can anyone show me how i setup an ftp cronjob to upload my stats to my websever. I have looked at some readme's but I never seem to get it right, so, any help is appreciated.
Sorry for posting in the wrong forum. Hopefully some kind admin/mod can move this to the correct forum over me posting an entirely new, but altogether identical in subject matter, thread.
I have got my shell provider to install curl and i can manually upload the stats now, but im unsure how i set this in a file and link it to a cronjob.
Here's a little shell script I wrote today to generate a pisg page and upload it to my website by ftp. Yes I could have written it in tcl, but I was being lazy.
#!/bin/bash
# max number of retries in case the 1st ftp attempt fails
maxit=10
#generate the new file by calling pisg
/home/mybot/pisg-0.68/pisg
# function to do the ftp - Assumes that your pisg file is called index.html
ftpf() {
ftp -n -i myisp.com<<SCRIPT
quote user myname
quote pass password
cd /remote/dir/on/myisp.com/path/www/pisg
lcd /home/mybot/pisg-0.68
put index.html
get index.html retrieved.html
quit
SCRIPT
# this verifies the transfer was successful
if [ -f retrieved.html ]
then
echo "upload: success"
rm -f retrieved.html
exit
else
echo "upload: failed - attempt $i"
sleep 60s
fi
}
# this gets the ball rolling and keeps it rolling until we exit with a success
# or reach $maxit number of retries
i=0
while [ $i -lt $maxit ]
do
i=`expr $i + 1`
ftpf
done