DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-07-27 21:35:55

wenzlerpaul
New member
Registered: 2009-07-27
Posts: 2

crontab alternative

Hi,

I am a new member here and I could say all of the things posted here helped me a lot.

I recently acquired my dns-323 and installed fun_plug and it was working good, I decided to update my firmware to 1.08 and so far so good, I am quite pleased with the performance.  However, I was trying to add a cron job and did the "editcron.sh" trick but somehow, the cron gets created on boot up, but weird stuff happens, the cron job disappears in few minutes.

I am not sure if this is because of the modifications I made on the firmware/fun_plug but I tried all my best and tested all that I can find on the net to no avail.

Anyways, I created my own alternative to cron since it was not working for me, below is the current setup I have.

fun_plug .05
packages installed
firmware 1.08

Since "at" is included on the OS, I created my own script to go around this crontab problem:

Steps I have done (note: you should have the ability to telnet or ssh your box to do this):

cd /mnt/HD_a2/ffp/start
vi zoneeditip.sh

add the code below without the asterisks (*):

****************************************************
#!/ffp/bin/sh

(put your rotating script on this line)

at NOW + 5 minutes < /mnt/HD_a2/ffp/start/zoneeditip.sh
****************************************************

explanation:
at NOW + 5 minutes = means to invoke the script plus 5 minutes of the current time, you can adjust the time according to what you need, refer to the link below on how to adjust time

/mnt/HD_a2/ffp/start/zoneeditip.sh = location of this script you just created

(put your rotating script on this line) = remove this entire line and replace it with what command you want to do like wget, curl, reboot.. etc...

when done, typing on vi environment, press ESC button on keyboard the type :wq then press Enter

make the script executable with the code below:

chmod a+x /mnt/HD_a2/ffp/start/zoneeditip.sh


you can either
reboot
or
/mnt/HD_a2/ffp/start/zoneeditip.sh
to invoke the script

you can check for the jobs running by typing
atq

If you wish to stop or kill a scheduled at job,

cd /var/spool/at
ls
rm jobnumber
(where job number is the code you will see similar to this a00075013d90d0)

this will stop the script from running.

Note:
This is not the best script I can come up with but at least it works as an alternative to crontab because of the nature of my difficulties making cron work on dns-323 box.  If you can make crontab work, that is the best option instead of this.

at reference
http://linux.about.com/library/cmd/blcmdl1_at.htm
http://linux.die.net/man/1/at

Hope it helps,
Paul

P.S.
I am no linux/unix master so pls be easy on me... also the tutorial is pointed to newbies alike... I am open for opinion and correction plus if you can suggest a better version would be highly appreciated... smile

Last edited by wenzlerpaul (2009-07-28 00:01:17)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB