Why? Maybe because you have several users? Btw, is it a spinner HDD or flash drive?So I like to disconnect the USB drive safely before the router loses power. But I don't want USB drive to lose power suddenly.
The Manual:Seem like I need help at the first hurdle. On the rooter I have enabled the JFFS customer scripts and configs. (Administration --> System)
I need help in the next step. how do I create script ? do I create scripts in notepad and save the file and then where I do upload the scripts?
A long time ago I had a strange problem with one of my computers and one certain usb flash drive. Even with safe removal I got random error messages, and scan for errors was suggested next time. I think there was a weird compatibility problem or something like that.I've had drives corrupted without safely removing the drive in the pass. With the USB stick I pulled it out of PCs and then when I plugged the USB stick back in I had warning message to scan for errors.
I like to request a nice to have feature. I have my router on timer plug which switches off and on automatically.
So I like to disconnect the USB drive safely before the router loses power. But I don't want USB drive to lose power suddenly.
#!/bin/sh
cru a ScheduledOff "58 22 * * * /sbin/halt"
#!/bin/sh
#
# /jffs/scripts/unmount
#
# stop entware prior to attempting to unmount the "entware volume"
#
# determine if this is the entware volume by comparing the '/opt' mountpoint to $1
OPT=$(dirname $(readlink /tmp/opt))
if [ "$1" == "$OPT" ] ; then
# this should be the same code as in 'services-stop', so you could just call services-stop instead
/opt/etc/init.d/rc.unslung stop
swapoff /opt/swap
fi
chmod +x /jffs/scripts/*
Be aware that halting the device only shuts it down for about a minute, or even less.cru a ScheduledOff "58 22 * * * /sbin/halt"
to unmount your usb drives and halt your router at 10:58 PM
(In my example it's 2 minutes earlier to make sure that this happens first, before your rotary timer "pulls the plug", so to speak)
My experience has been different. The halt command totally makes my router unresponsive till I reset power on it.Be aware that halting the device only shuts it down for about a minute, or even less.
Depending when the watchdog kicks in it will resume normal operation in no time
#!/bin/sh
cru a ScheduledOff "58 22 * * * /sbin/halt"
I like to request a nice to have feature. I have my router on timer plug which switches off and on automatically.
How do you "shutdown normally"?not allowing the router to shutdown normally
Yes, that's how it's normally done... but remember this isn't Linux. There is no shutdown command and no init scripts. The busybox halt command effectively does the same thing. First it sync's the filesystem, then it sends a terminate signal to all the running processes.I suppose if one were to do a sync, sync, shutdown -h now and put in in a crontab entry before the timer turns off mains power...
This way all the file systems are synced up, and then linux executes the init scripts to shutdown the system politely...
that would probably be best...
Mar 16 14:46:17 kernel: SysRq : Emergency Sync
Mar 16 14:46:17 kernel: Emergency Sync complete
Mar 16 14:46:17 WEBDAV Server: daemon is stopped
Mar 16 14:46:17 NFS Server: daemon is stopped
Mar 16 14:46:19 Timemachine: daemon is stopped
Mar 16 14:46:19 MediaServer: daemon is stopped
Mar 16 14:46:19 iTunes: daemon is stopped
Mar 16 14:46:19 FTP Server: daemon is stopped
Mar 16 14:46:19 Samba Server: smb daemon is stopped
Mar 16 14:46:19 kernel: gro disabled
Mar 16 14:46:19 miniupnpd[1180]: shutting down MiniUPnPd
Mar 16 14:46:20 dnsmasq[3300]: exiting on receipt of SIGTERM
Mar 16 14:46:20 dnscrypt-proxy: stop dnscrypt-proxy
Mar 16 14:46:22 dropbear[24645]: Exit (admin): Terminated by signal
Mar 16 14:46:22 dropbear[593]: Early exit: Terminated by signal
Mar 16 14:46:22 wan6: wan6 interface v6in4 is down
Mar 16 14:46:22 stop_wan(): perform DHCP release
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!