NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
freewun13
Oct 19, 2018Aspirant
Cron Jobs after NVX System Reset
Hi All,
When I got my NVX back in 2009 I started playing around with cron jobs to do a few things and they worked fine.
I just recently did a system reset and I saved all the text associated with my cron jobs etc. I have reinstalled SSH Root add on and get in fine with Putty but when I type in crontab -e I just get....
-bash: $: command not found
I dont normally have anything to do with scripting etc and I know all those years back a lot of guys on the netgear forum helped me to get it all to work.
I have tried searching for all my posts from 2009 etc and could only find from 2011 onwards.
Any help would be much appreciated and I will be saving all the instructions this time and not rely on the forum to keep all the info this time lol :-)
Thank you
Did you do the apt-get update again (after you modified sources.list)?
21 Replies
Replies have been turned off for this discussion
- StephenBGuru - Experienced User
freewun13 wrote:
-bash: $: command not found
I get this:
PRO:~# crontab -e
no crontab for root - using an empty one
/bin/sh: /usr/bin/editor: No such file or directory
crontab: "/usr/bin/editor" exited with status 127You do need to log in as root. crontab should be in /usr/bin
PRO:~# which crontab
/usr/bin/crontab- freewun13Aspirant
LIke I said...this was a long time ago so I have even less of an idea now! From Putty....
Using username "root".
root@192.168.1.6's password:
Last login: Fri Oct 19 21:36:16 2018 from 192.168.1.10
Last login: Fri Oct 19 21:38:41 2018 from 192.168.1.10 on pts/0
Linux NAS 2.6.37.6.RNx86_32.1.4 #1 Thu May 28 16:18:23 PDT 2015 i686 GNU/Linux
NAS:~# cd /usr/bin/
NAS:/usr/bin# ~# which crontab
-bash: ~#: command not found
NAS:/usr/bin# crontab -e
no crontab for root - using an empty one
/bin/sh: /usr/bin/editor: No such file or directory
crontab: "/usr/bin/editor" exited with status 127
NAS:/usr/bin#- StephenBGuru - Experienced User
freewun13 wrote:
NAS:~# cd /usr/bin/
NAS:/usr/bin# ~# which crontab
-bash: ~#: command not foundSomething is wrong here. If you have a spare disk, try doing a factory install with only that disk in place. Then see if you get the same result.
What firmware are you running?
- freewun13Aspirant
Here is one of the tasks I had running. Pinging various IP's around the house and then shutting down the NAS. So I had a file called pingmedia.sh and the cron job running the ping on a schedule. I just cant figure out how to create the ping media file or create the cron job....
nano ~/pingmedia.sh
#!/bin/bash
# Ping Main Bed TV
ping -c 2 192.168.1.50 > /dev/null
if [ $? != 0 ]
then
# Ping Desktop
ping -c 2 192.168.1.10 > /dev/null
if [ $? != 0 ]
then
# Ping VPN
ping -c 2 192.168.1.200 > /dev/null
if [ $? != 0 ]
then
# Ping Media Server 1 Lounge
ping -c 2 192.168.1.51 > /dev/null
if [ $? != 0 ]
then
# Ping Yamaha Amplifier Lounge
ping -c 2 192.168.1.53 > /dev/null
if [ $? != 0 ]
then
# Ping Media Server 1 Lounge
ping -c 2 192.168.1.51 > /dev/null
if [ $? != 0 ]
then
# Ping Desktop
ping -c 2 192.168.1.10 > /dev/null
if [ $? != 0 ]
then
# Ping Main Bed TV
ping -c 2 192.168.1.50 > /dev/null
if [ $? != 0 ]
then
# Ping VPN
ping -c 2 192.168.1.200 > /dev/null
if [ $? != 0 ]
then
# command to shutdown:
/frontview/bin/autopoweroff & /dev/null
fi
fi
fi
fi
fi
fi
fi
fi
ficrontab -e
# m h dom mon dow command
00-59/05 22 * * * ~/pingmedia.sh
00-59/05 23 * * * ~/pingmedia.sh
00-59/05 00 * * * ~/pingmedia.sh
00-59/05 01 * * * ~/pingmedia.shalso trying to do the shutdown with...... ~# /frontview/bin/autopoweroff & /dev/null
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!