How to delete a persistent cronjob

All about firmwares for routers. Support for RouterTech firmwares is here too.
Post Reply
bingel
Novice
Novice
Posts: 29
Joined: Tue Jul 09, 2013 2:07 am

How to delete a persistent cronjob

Post by bingel » Sun Nov 24, 2013 3:53 pm

I would like to setup a persistent cronjob through the cronjob-env.sh script but I'm afraid how could I delete this job in a future because no instructions found.
bingel
Novice
Novice
Posts: 29
Joined: Tue Jul 09, 2013 2:07 am

Re: How to delete a persistent cronjob

Post by bingel » Sun Nov 24, 2013 4:38 pm

I think to have solved:

Code: Select all

unsetenv env_variable_name

Is this sufficient?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: How to delete a persistent cronjob

Post by thechief » Sun Nov 24, 2013 4:51 pm

Yes. And there are instructions about it: firmware-faq/#cron
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
bingel
Novice
Novice
Posts: 29
Joined: Tue Jul 09, 2013 2:07 am

Re: How to delete a persistent cronjob

Post by bingel » Sun Nov 24, 2013 5:37 pm

Thank you.

...but now I have a problem with a very long command. It is not executed.

I think because the command string is too long to be contained in an evironmental variable.

The output of this command:

Code: Select all

getenv
is:

Code: Select all

RT_cmd_ddns     write_crontab.sh '*/5' '*' '*' '*' '*' 'wget -O - -q --read-timeout
instead the entire command should be:

Code: Select all

RT_cmd_ddns     write_crontab.sh '*/5' '*' '*' '*' '*' 'wget -O - -q --read-timeout=0.0 --waitretry=5 --tries=400 --background http://freedns.afraid.org/dynamic/update.php?Long_string...'

Is there a way to put this command in a file script then execute that script?
bingel
Novice
Novice
Posts: 29
Joined: Tue Jul 09, 2013 2:07 am

Re: How to delete a persistent cronjob

Post by bingel » Sun Nov 24, 2013 6:34 pm

Moreover, could you explain to me how to use the "onconnectWAN" command?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: How to delete a persistent cronjob

Post by thechief » Sun Nov 24, 2013 8:09 pm

bingel wrote:Is there a way to put this command in a file script then execute that script?
Yes. Create a minix partition and put the script there. Read the firmware FAQ. If you name the script "startup.sh" on the minix partition (/nvram/)then it will be executed automatically each time the router boots up.
bingel wrote:Moreover, could you explain to me how to use the "onconnectWAN" command?
You don't.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
bingel
Novice
Novice
Posts: 29
Joined: Tue Jul 09, 2013 2:07 am

Re: How to delete a persistent cronjob

Post by bingel » Mon Nov 25, 2013 12:21 am

I have only 2MB flash memory on my router and my firmware version is normal, not lite, so I think it is not possibile to create a minix filesystem (according to instructions).

...but have you any idea because the env variables can't be longer than a certain number of chars?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: How to delete a persistent cronjob

Post by thechief » Mon Nov 25, 2013 10:40 am

bingel wrote:I have only 2MB flash memory on my router and my firmware version is normal, not lite, so I think it is not possibile to create a minix filesystem (according to instructions).
You are correct. You need the Lite version for that.
bingel wrote:...but have you any idea because the env variables can't be longer than a certain number of chars?
With the Adam2 bootloader, there is a limit of 80 characters. With the PSP bootloader, the limit is bigger (perhaps 128 characters or more).
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
bingel
Novice
Novice
Posts: 29
Joined: Tue Jul 09, 2013 2:07 am

Re: How to delete a persistent cronjob

Post by bingel » Mon Nov 25, 2013 2:20 pm

Ok, thank you again.
Post Reply