| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Tue May 03, 2016 7:50 am Post subject: Is posible? |
|
|
How I can do to make the bot save me a file that is accessible from the outside via IP : port , which can be read by another program ?
To be hosted on a VPS , share the IP with my web , but the web content is elsewhere (not in the VPS)
Is it possible? Mmm ..... _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue May 03, 2016 8:31 am Post subject: Re: Is posible? |
|
|
| juanamores wrote: | How I can do to make the bot save me a file ...
|
Go here:
http://forum.egghelp.org/viewtopic.php?t=6885
and read about how to write TCL that will write to a text file.
| Quote: |
... that is accessible from the outside via IP : port , ...
|
This would be handled by something else - not eggdrop itself.
Perhaps you would want some bash script, driven by crontab, to move the new file.
| Quote: |
...which can be read by another program ?
|
This depends on the permissions of the new directory and the permissions on the file.
| Quote: |
To be hosted on a VPS , share the IP with my web , but the web content is elsewhere (not in the VPS)
Is it possible? Mmm ..... |
Not exactly sure what you are asking here.
But if you are asking there is a way to copy this new file that Eggdrop has created for you, to another location somewhere on the web - then it is possible.
Google for bash scripts that automate ftp .
Here:
https://www.linux.com/blog/ftp-file-transfer-automated-bash-script
is a quick example.
Here:
http://serverfault.com/questions/279176/ftp-uploading-in-bash-script
is a bit more info on it.
And here:
http://www.stratigery.com/scripting.ftp.html
But you should research it more for yourself.
I hope this helps. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Wed May 04, 2016 3:10 pm Post subject: Re: Is posible? |
|
|
| willyw wrote: |
Perhaps you would want some bash script, driven by crontab, to move the new file.
...........
But if you are asking there is a way to copy this new file that Eggdrop has created for you, to another location somewhere on the web - then it is possible.
Google for bash scripts that automate ftp .
................
|
Thank you very much willyw, I think they are excellent ideas about the bash script added to a crontab.
I 'll work on it .
regards _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu May 05, 2016 2:11 am Post subject: |
|
|
You could also have a look at user's socket api - nonblocking tcp made easy topic where he shared some interesting things. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri May 06, 2016 12:13 am Post subject: |
|
|
Thanks caesar by your contribution, and I did work with a bash script , I have a problem with me crontab does not work with this script
It's weird, because all crontabs works properly .
I used this example to the bash.
My crontab entry for this script is:
| Code: | | * */1 * * * /home/juan/mycode.sh >/dev/null 2>&1 |
Script doesn't run via crontab, but works fine standalone in the linux console with:
I've tried other configurations without success for the moment ... _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri May 06, 2016 1:06 am Post subject: |
|
|
Try with add adding sh in front of the path like:
| Code: |
* */1 * * * sh /home/juan/mycode.sh > /dev/null 2>&1
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri May 06, 2016 3:47 am Post subject: |
|
|
Neither it worked .
Can I see behavior this cron by console , to see bugs? _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri May 06, 2016 10:11 am Post subject: |
|
|
Try with:
| Code: |
0 * * * * sh /home/juan/mycode.sh > /dev/null 2>&1
|
You wanted a every hour execution, right? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri May 06, 2016 10:22 am Post subject: |
|
|
It has to be every minute, this script checks the change songs on the radio .
The songs last more than a minute, but the DJ can change the song, so you should check minute a minute.
I try and and | Code: | | 1,2,3......59 * * * * | y don´t work.
But, you think the cron does not work for the short period of time?
I tried every 3 and every 5 minutes and it has not worked .
I think that is another problem ... _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri May 06, 2016 10:30 am Post subject: |
|
|
| juanamores wrote: |
...
| Code: | * */1 * * * /home/juan/mycode.sh >/dev/null 2>&1
|
|
| Quote: |
...It has to be every minute, ...
|
Your line quoted first above, is not the standard way of doing 'every minute'.
Check out:
https://www.pantz.org/software/cron/croninfo.html
for an example of how to do it every minute.
I hope this helps. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri May 06, 2016 10:33 am Post subject: |
|
|
This is the usual way of doing 'every minute'
I just noticed this post of yours now.... _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri May 06, 2016 11:32 am Post subject: |
|
|
For every 1 minute shouldn't it be */1 * * * * ? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sat May 07, 2016 3:02 pm Post subject: |
|
|
Supposedly with the following code, puts the output of the commands into the log file "mylog", but is not stored in /var/log/mylog
| Code: | | * * * * * /home/juan/mycode.sh >>/var/log/mylog |
| Code: | [juan@vps804251 ~]$ cd /var/log
[juan@vps174886 log]$ pwd
/var/log
[juan@vps174886 log]$ find mylog
find: ‘mylog’: No such file or directory
|
With the "ls" command I do not see that file.
Conclusion: crontab does not run  _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat May 07, 2016 3:39 pm Post subject: |
|
|
| juanamores wrote: |
...
Conclusion: crontab does not run |
Do something more simple to test if crontab is running.
Use nano to create a plain text file - in your home dir - with one line in it, like this:
| Code: |
date >> /home/your_name_here/somefilename
|
Use chmod to make this new file you have just created executable.
If you named the new file tempfile , it would be
chmod u+x tempfile
Check to be sure it is executable by viewing the list of files and permissions with:
ls -latr
Next:
add a line like this in crontab:
| Code: |
* * * * * /home/your_name_here/tempfile >/dev/null 2>&1
|
and save.
It will run once every minute.
(I just did this - that above line is copy-n-paste from my crontab, with one obvious edit - and it works.
It will write the date and time to the file named somefilename
in your home dir, every minute, on the minute.
It will be very easy to see if it is working.  _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sat May 07, 2016 4:15 pm Post subject: |
|
|
I had problems permission to record the file jajaja!
I could already record the log in my directory and I found something interesting ....
The crontab runs !
But , not upload nothing ....
The crontab log:
| Quote: | local: live.txt remote: live.txt
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout. |
What worries me is this: You uploaded 0
Manually ejecution log:
| Quote: | local: live.txt remote: live.txt
227 Entering Passive Mode (xxx,xxx,xx,xxx,227,44)
150 Accepted data connection
226-File successfully transferred
226 0.006 seconds (measured here), 4.62 Kbytes per second
28 bytes sent in 5,1e-05 secs (549,02 Kbytes/sec)
221-Goodbye. You uploaded 1 and downloaded 0 kbytes.
221 Logout. |
New conclusion: If the script execution is manually upload the file, if done through a crontab not upload.
Any suggestions ? _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
|