| View previous topic :: View next topic |
| Author |
Message |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Fri Sep 03, 2010 2:43 pm Post subject: Pisg 0.72 auto update cannot find executable [SOLVED] |
|
|
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: | [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: | #!/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: | #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 |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Sep 03, 2010 3:01 pm Post subject: |
|
|
Where is generate_logs located? Is it set to chmod +x generate_logs ? _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Fri Sep 03, 2010 3:17 pm Post subject: |
|
|
Its in the /home/marvz/stats directory. I changed all the permissions to:
| Code: | | Unix mode = -rwxrwxrwx |
So I changed them to that thinking that it must've been those permissions but it still doesn't work. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Sun Sep 05, 2010 1:13 pm Post subject: |
|
|
| Yes. I changed it all and it still says the same error message. |
|
| Back to top |
|
 |
devilsoulblack Halfop

Joined: 19 Nov 2003 Posts: 62 Location: Chile
|
Posted: Tue Sep 07, 2010 2:26 am Post subject: |
|
|
use cron for run pisg and the same cron uso lftp to upload to other host
| Code: | */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 |
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Tue Sep 07, 2010 11:42 am Post subject: |
|
|
| devilsoulblack wrote: | use cron for run pisg and the same cron uso lftp to upload to other host
| Code: | */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. |
|
| Back to top |
|
 |
devilsoulblack Halfop

Joined: 19 Nov 2003 Posts: 62 Location: Chile
|
Posted: Tue Sep 07, 2010 6:03 pm Post subject: |
|
|
| marvz wrote: | | devilsoulblack wrote: | use cron for run pisg and the same cron uso lftp to upload to other host
| Code: | */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 |
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Tue Sep 07, 2010 7:34 pm Post subject: |
|
|
| devilsoulblack wrote: | | marvz wrote: | | devilsoulblack wrote: | use cron for run pisg and the same cron uso lftp to upload to other host
| Code: | */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: | | */55 * * * * lftp -u DonT.[censored].WHoiS.Me |
would this be the ftp server?
That's obvious. I got this part
| Code: | | channels.dal.net -e |
is this where I would put the irc network I am in?
| Code: | | "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. |
|
| Back to top |
|
 |
devilsoulblack Halfop

Joined: 19 Nov 2003 Posts: 62 Location: Chile
|
Posted: Tue Sep 07, 2010 8:13 pm Post subject: |
|
|
marvz
| Code: | | */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  _________________ ---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ |
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Tue Sep 07, 2010 9:14 pm Post subject: |
|
|
| devilsoulblack wrote: | marvz
| Code: | | */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  |
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? |
|
| Back to top |
|
 |
devilsoulblack Halfop

Joined: 19 Nov 2003 Posts: 62 Location: Chile
|
Posted: Tue Sep 07, 2010 9:23 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Tue Sep 07, 2010 9:27 pm Post subject: |
|
|
| 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
so, I don't know if its loaded and working. |
|
| Back to top |
|
 |
devilsoulblack Halfop

Joined: 19 Nov 2003 Posts: 62 Location: Chile
|
|
| Back to top |
|
 |
marvz Halfop
Joined: 18 Jun 2010 Posts: 64
|
Posted: Thu Sep 30, 2010 12:43 pm Post subject: |
|
|
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: | */25 * * * * /path.to/executable/pisg-0.72/pisg
|
This will use lftp to upload the file to the hosting server every 29 minutes
| Code: | */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] |
|
| Back to top |
|
 |
|