This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

ftp + pisg

Help with usage of shell accounts and bouncers.
Post Reply
r
rias
Voice
Posts: 2
Joined: Tue Feb 14, 2006 8:59 pm

ftp + pisg

Post by rias »

For crontab create a file called "pisgchek" and chmod it 755.

Here is the content of my file:
Code:
#!/bin/sh

statsbin="./pisg"
statpath="/home/Ballarat/public_html/pisg-0.52"

cd $statpath

$statsbin

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.

Thanks
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

wrong forum dude

and set up your cron script using wget or curl
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

i use weex to upload mine together with cron http://weex.sourceforge.net/

Code: Select all

# the configuration of 1st host
[pisg-site1]
HostName	= ftp.site.co.uk
LoginName	= loginname
Password	= password
SrcDir		= /home/pisg/site1/
DestDir		= /pisg/site1

IgnoreLocalFile	= {
}

IgnoreRemoteDir	= {
}
you then can set up cron to run "weex pisg-site1"
<- tcl newb
r
rias
Voice
Posts: 2
Joined: Tue Feb 14, 2006 8:59 pm

Post by rias »

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.

Really appreciate help on this last part.

Code: Select all

curl -T public_html/stats -u me@me.com:passhere ftp://me.com/ircstats/
All i need is a way to fit that code in a file like: "pisgupload" and then attach a crobjob to match the pisg update intervals of 30 mins.

Thankyou.
M
Minus
Voice
Posts: 8
Joined: Sat Jul 01, 2006 4:42 pm

Post by Minus »

rias looking for the same did you get it to work?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

bash script to generate/upload pisg page

Post by rosc2112 »

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.

Code: Select all

#!/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
This can be run from cron if you wish.
Post Reply