aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Online signature script  (Read 2316 times)

dashaund

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 25
Online signature script
« on: March 02, 2005, 11:36:10 PM »

Okay, so I've got AMPS running smoothly and it is publishing my stats (http://dashaund.no-ip.info/).  I've even got my online signature posted, as you can see.  My only problem is how do I get it to refresh my created amule.png file.  I have Apache running on the same machine, so everything is good there.  I have dabbled in Linux for years (this machine runs FC3), but have no idea how to run a cron job.  Anyone have a script I can download, or any tips?  Everything is perfect except updating the png file, which I can do manually using wget.  Here's what I key in just for reference:

Quote
wget -O /var/www/html/amps-0.7.5/amule.png 'http://dashaund.no-ip.info/amps-0.7.5/index.php?lang=en&sig_image'
« Last Edit: March 02, 2005, 11:44:01 PM by dashaund »
Logged

thedude0001

  • evil bugfinder ;)
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 827
Re: Online signature script
« Reply #1 on: March 03, 2005, 12:35:39 AM »

cron is actually quite easy. Do a 'crontab -e' to edit your crontab. It will fire up your default editor (possibly vi or nano) and probably an empty file. Here you can enter somethin like this:

Code: [Select]
0  * * * * wget -O /var/www/html/amps-0.7.5/amule.png 'http://dashaund.no-ip.info/amps-0.7.5/index.php?lang=en&sig_image'
That will execut the given command every full hour. The first five entrys tell cron when to execute this command. they mean:
Code: [Select]
field          allowed values
-----          --------------
minute         0-59
hour           0-23
day of month   1-31
month          0-12 (or names, see below)
day of week    0-7 (0 or 7 is Sun, or use names)

you can use * as a wildcard and comma separated values and some more fancy stuff, just enter 'man 5 crontab' in a console to take a closer look.
Logged
Das Schlimme auf dieser Welt ist
daß die Dummen so selbstsicher sind
und die Gescheiten so voller Zweifel.

dashaund

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 25
Re: Online signature script
« Reply #2 on: March 03, 2005, 04:23:34 AM »

Thanks thedude0001.  I had read up on crontab but wasn't sure exactly what to do...that cleared it up.  It's weird because in FC3 when you edit the contab file, it writes it to the /tmp directory, and doesn't apply the changes to the correct file.  My root cron file is in /var/spool/cron/, so I had to open that up with emacs to get it to work.  After that change, I'm rocking now.  You guys are awesome, even though it was really easy.  Maybe someone should create a total AMPS guide in the wiki  ;).
Logged

thedude0001

  • evil bugfinder ;)
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 827
Re: Online signature script
« Reply #3 on: March 03, 2005, 02:28:22 PM »

Yes, it is quite normal and absolutely ok that 'crontab -e' saves the file somewhere in the temp directory. However, if you quit the editor with the open crontab it will install the new crontab to where it belongs. This is a safety mechanism as you are working on a file that is already in use. Please try making some edit with 'crontab -e', save it, quit the editor and see is it worked. You shouldn't trick around that safety line  ;)
Logged
Das Schlimme auf dieser Welt ist
daß die Dummen so selbstsicher sind
und die Gescheiten so voller Zweifel.