egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ftp + pisg

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Shell & Bouncer Help
View previous topic :: View next topic  
Author Message
rias
Voice


Joined: 14 Feb 2006
Posts: 2

PostPosted: Tue Feb 14, 2006 9:08 pm    Post subject: ftp + pisg Reply with quote

Quote:
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
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Feb 14, 2006 11:15 pm    Post subject: Reply with quote

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] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Wed Feb 15, 2006 2:55 am    Post subject: Reply with quote

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

Code:
# 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
Back to top
View user's profile Send private message
rias
Voice


Joined: 14 Feb 2006
Posts: 2

PostPosted: Wed Feb 15, 2006 11:09 am    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message
Minus
Voice


Joined: 01 Jul 2006
Posts: 8

PostPosted: Tue Aug 01, 2006 1:27 pm    Post subject: Reply with quote

rias looking for the same did you get it to work?
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Aug 08, 2006 11:27 pm    Post subject: bash script to generate/upload pisg page Reply with quote

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:

#!/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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Shell & Bouncer Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber