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.

Pisg 0.72 auto update cannot find executable [SOLVED]

Support & discussion of released scripts, and announcements of new releases.
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Pisg 0.72 auto update cannot find executable [SOLVED]

Post by marvz »

So I downloaded the pisg new tcl script to auto update the stats and ftp them to the hosting server. I set up the config and generate logs options and I get this message in the partyline

Code: Select all

[14:22] Generating Stats...
[14:22] Tcl error [pub:statsgen]: couldn't execute "/home/marvz/stats/generate_logs": no such file or directory
Here is the generate logs conf file

Code: Select all

#!/usr/local/bin/bash
#
#Your PISG executable location
PISG_DIR="/home/marvz/pisg-0.72/pisg"

#FTP Hostname
FTP_HOST="ftp.aaron5k.com"

#FTP Username
FTP_USER="****"

#FTP Password
FTP_PASS="********"

#Directory to upload your html file too
FTP_DIR="/publichtml/irc4lyf/statz/"

#HTML File name. I suggest you don't touch this if
#your putting it in it's own directory.
INDEX_FILE="index.html"


#DO NO EDIT BELOW HERE

$PISG_DIR psig.cfg

ftp -Vu ftp://$FTP_USER:$FTP_PASS@$FTP_HOST/$FTP_DIR $INDEX_FILE

here is the tcl script file:

Code: Select all

#This is a rewrite of pisg.tcl so now when people request !stats
#If it is not the $statsnick requesting it, it will just show the url and not generate the logs
#also the $statsexe setting goes to a bash script i have made to generate and upload the logs via ftp
#to the directory that you set in generate_logs
#
#irc.bsdaxis.net #BSDAxis
#Trip-Out
set statsexe "/home/marvz/stats/generate_logs"
set statsurl "http://www.irc4lyf.com/statz"
set statschan "#spf"
set statsflags "nmof"
set statstime "720"
set statsnick "marvz"

bind pub $statsflags !stats pub:statsgen

proc pub:statsgen {nick host hand chan arg} {
        global statsurl statschan statsexe statsnick
        if {$nick != $statsnick} {
        putlog "$nick Requested Stats"
        append out "PRIVMSG $statschan :\002Stats Available At:\002 $statsurl"
        } else {
        putlog "Generating Stats..."
        exec $statsexe
        append out "PRIVMSG $statschan :\002Stats Updated:\002 $statsurl"
        putlog "Stats Updated."
        }
        puthelp $out
}

proc statstimer {} {
        global statsexe statsurl statschan statstime
        puthelp "PRIVMSG $statschan : \002Stats Updated:\002 $statsurl"
        timer $statstime statstimer
}

if {![info exists {statsset}]} {
  set statsset 1
  timer 2 statstimer
}

putlog "pisg-new.tcl 1.0 By Trip-Out Loaded"
I've tried different settings on the path and nothing seems to work. Any help or suggestions are appreciated! Thanks in advance!
Last edited by marvz on Thu Sep 30, 2010 12:44 pm, edited 1 time in total.
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Where is generate_logs located? Is it set to chmod +x generate_logs ?
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

Its in the /home/marvz/stats directory. I changed all the permissions to:

Code: Select all

Unix mode = -rwxrwxrwx
So I changed them to that thinking that it must've been those permissions but it still doesn't work.
User avatar
CrazyCat
Revered One
Posts: 1247
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

is /home/marvz/stats in 777 mode too ?
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

Yes. I changed it all and it still says the same error message.
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

use cron for run pisg and the same cron uso lftp to upload to other host

Code: Select all

*/55 * * * * lftp -u DonT.[censored].WHoiS.Me,PASSWORD channels.dal.net -e "cd www ; cd stats ; put /home/aandaluz/stats/DonTFuCKiNgWHoiSMe/index.html ; quit"
*/48 * * * * /home/aandaluz/stats/pisg-0.72/pisg
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

devilsoulblack wrote:use cron for run pisg and the same cron uso lftp to upload to other host

Code: Select all

*/55 * * * * lftp -u DonT.[censored].WHoiS.Me,PASSWORD channels.dal.net -e "cd www ; cd stats ; put /home/aandaluz/stats/DonTFuCKiNgWHoiSMe/index.html ; quit"
*/48 * * * * /home/aandaluz/stats/pisg-0.72/pisg
I'm sorry, I don't understand what you mean.
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

marvz wrote:
devilsoulblack wrote:use cron for run pisg and the same cron uso lftp to upload to other host

Code: Select all

*/55 * * * * lftp -u DonT.[censored].WHoiS.Me,PASSWORD channels.dal.net -e "cd www ; cd stats ; put /home/aandaluz/stats/DonTFuCKiNgWHoiSMe/index.html ; quit"
*/48 * * * * /home/aandaluz/stats/pisg-0.72/pisg
I'm sorry, I don't understand what you mean.
the first cron upload every 55 min to ftp
the scond cron execute pisg every 48 min
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

devilsoulblack wrote:
marvz wrote:
devilsoulblack wrote:use cron for run pisg and the same cron uso lftp to upload to other host

Code: Select all

*/55 * * * * lftp -u DonT.[censored].WHoiS.Me,PASSWORD channels.dal.net -e "cd www ; cd stats ; put /home/aandaluz/stats/DonTFuCKiNgWHoiSMe/index.html ; quit"
*/48 * * * * /home/aandaluz/stats/pisg-0.72/pisg
I'm sorry, I don't understand what you mean.
the first cron upload every 55 min to ftp
the scond cron execute pisg every 48 min
Ok, the second crontab I get. Its the one that runs the ./pisg command and generates the html file.

The first one is confusing to me.

Code: Select all

*/55 * * * * lftp -u DonT.[censored].WHoiS.Me
would this be the ftp server?

Code: Select all

PASSWORD
That's obvious. I got this part :)

Code: Select all

channels.dal.net -e 
is this where I would put the irc network I am in?

Code: Select all

"cd www ; cd stats ; put /home/aandaluz/stats/DonTFuCKiNgWHoiSMe/index.html ; quit"
I'm assuming that this would be the commands that the crontab runs on the server to get into the stats directory.

What I am also not understanding is how does it know what file to upload to the hosting server. I'm sorry if this is repetitive but I seriously don't understand this part of it. Thanks again.
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

marvz

Code: Select all

*/55 * * * * lftp -u USERNAME-OF-FTP-HOST,PASSWORD-OF-FTP-HOST HOSTNAME.COM -e "cd www ; cd stats ; put /PATH/WHERE/GENERATE/PISG/index.html ; quit" 
now you understand ?

sorry for my lang i dont speak english :P
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

devilsoulblack wrote:marvz

Code: Select all

*/55 * * * * lftp -u USERNAME-OF-FTP-HOST,PASSWORD-OF-FTP-HOST HOSTNAME.COM -e "cd www ; cd stats ; put /PATH/WHERE/GENERATE/PISG/index.html ; quit" 
now you understand ?

sorry for my lang i dont speak english :P
Thanks for the explanation. I set up the crontabs in the server. is there a way to test it out or should I just wait and see if it works?
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

what part you need to test ? the lftp or the pisg execute ?
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

devilsoulblack wrote:what part you need to test ? the lftp or the pisg execute ?
Both of them. I just want to make sure they're working. Once I know that they're working fine I can just let them roll and do their thing.

I typed in

Code: Select all

crontab pisg
so, I don't know if its loaded and working.
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
m
marvz
Halfop
Posts: 64
Joined: Fri Jun 18, 2010 2:37 pm

Post by marvz »

Ok, after messing with cron I finally got it working. This is based on a FreeBSD server. It may differ slightly on a UNIX server but it should be relatively the same.

This will run pisg and generate the HTML file every 25 minutes.

Code: Select all

*/25 * * * * /path.to/executable/pisg-0.72/pisg

This will use lftp to upload the file to the hosting server every 29 minutes

Code: Select all

*/29 * * * * /path.to/executable/lftp/bin/lftp -u username,password hosting.server -e "set passive-mode 0; cd directory.where.HTML.file.is.located.on.hosting.server ; put /directory.where.pisg.places.generated.HTML.file/index.html ; quit" 

The problems I ran into were
1) lftp wasn't compiled on the server where my bot is hosted. I had to manually install it and actually tell the cron to use the one I compiled. It helped that I put the whole path and not use the ~ shortcut. You may not have lftp installed on your shell so you might want to ask your provider what they have compiled on your shell. You could also just download lftp and compile yourself. Its up to you.

2) The server I use to host the stats also "marries" the IP that you use the first time that you log into the server. This is a security feature that some hosting companies use. I had to telnet into the hosting server from the bot shell so it would allow the cron to upload stats.

3)Some servers require you to set passive modes on them in order to allow you to ftp into them. I also had to add this to the cron.

Overall, it is working great! Thanks to all that helped out and devilsoulblack for the initial cron suggestion. I used his as a base to start and modified it to fit my needs. Hope this helps out.[/list]
Post Reply