[SOLVED] Custom Script is not working - Netgear R7000

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
LightMoon
DD-WRT User


Joined: 09 Sep 2012
Posts: 64

PostPosted: Sun Sep 12, 2021 5:26    Post subject: [SOLVED] Custom Script is not working - Netgear R7000 Reply with quote
Hi,

I want to set up an automatic dd-wrt config back up and schedule it to run every night; however, I cannot find the custom script in /tmp.

Can someone tell me where it is saved?

The firmware on the router is DD-WRT v3.0-r47381 std (09/08/21)

#!/bin/sh
#########################################################
# Auto Backup configuration
#########################################################
nvram backup /tmp/nvrambak.`date "+%F"`.bin
sleep 2
tftp -p 192.168.10.25 -l /tmp/nvrambak.`date "+%F"`.bin
sleep 2
rm -f /tmp/nvrambak.`date "+%F"`.bin

_________________
Netgear R7000
(Latest SVN revision)
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14126
Location: Texas, USA

PostPosted: Sun Sep 12, 2021 5:49    Post subject: Reply with quote
/tmp/.rc_custom if you are on any current release.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
LightMoon
DD-WRT User


Joined: 09 Sep 2012
Posts: 64

PostPosted: Sun Sep 12, 2021 7:30    Post subject: Reply with quote
kernel-panic69 wrote:
/tmp/.rc_custom if you are on any current release.


Thanks mate,

I can successfully run the script from the ssh with sh /tmp/.rc_custom and everything is working as expected; however, I have difficulties in setting up the corn job for the rc_custom file.

here is my corn job setting which resulted in nothing

* * * * * root /bin/sh -c '/tmp/.rc_custom'

Am I missing something?

I tried to do some troubleshooting and run it from the ssh with the following command, which got Permission denied.

root@DD-WRT-C2:/tmp# /bin/sh -c '/tmp/.rc_custom'
/bin/sh: /tmp/.rc_custom: Permission denied

_________________
Netgear R7000
(Latest SVN revision)
LightMoon
DD-WRT User


Joined: 09 Sep 2012
Posts: 64

PostPosted: Sun Sep 12, 2021 7:58    Post subject: Reply with quote
all good,

add the #!/bin/sh at the beginning and start working.

here is why - https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=165234

_________________
Netgear R7000
(Latest SVN revision)
d33b0_n4p41m
DD-WRT User


Joined: 10 Sep 2021
Posts: 133

PostPosted: Sun Sep 12, 2021 11:30    Post subject: Reply with quote
Glad you were able to get it sorted, mate!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum