tr0910 Posted October 16, 2011 Share Posted October 16, 2011 Can I do the following? Normal startup of unraid, then execute a number of script files then email me the results, then powerdown? The following works from a telnet session when executed one line at a time, but when put in the go script, it fails quickly claiming is it unable to find my script files. #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c cd /boot /boot/othermounts.sh /boot/syncdisk4.sh /boot/syncdisk3.sh /boot/syncdisk2.sh /boot/syncdisk1.sh ssmtp [email protected] < /boot/logs/cronlogs/t1summary.log powerdown Here is the snipped of the log file where it is attempting to run the above Oct 16 14:34:50 Tower1 emhttp: shcmd (3): /usr/local/sbin/emhttp_event driver_loaded Oct 16 14:34:50 Tower1 emhttp_event: driver_loaded Oct 16 14:34:50 Tower1 init: Re-reading inittab Oct 16 14:34:50 Tower1 sSMTP[1910]: Unable to locate smtp.gmail.com Oct 16 14:34:50 Tower1 sSMTP[1910]: Cannot open smtp.gmail.com:587 Oct 16 14:34:50 Tower1 logger: Powerdown initiated Oct 16 14:34:50 Tower1 rc.unRAID[1914]: Stopping unRAID. Quote Link to comment
dgaschk Posted October 16, 2011 Share Posted October 16, 2011 Try adding a delay: sleep 20 Is DNS set in the webGUI? Quote Link to comment
Joe L. Posted October 17, 2011 Share Posted October 17, 2011 Try adding a delay: sleep 20 Is DNS set in the webGUI? those lines indicate you either do not have a nameserver defined, or do not have a network gateway defined. Quote Link to comment
tr0910 Posted October 17, 2011 Author Share Posted October 17, 2011 Try adding a delay: sleep 20 Is DNS set in the webGUI? those lines indicate you either do not have a nameserver defined, or do not have a network gateway defined. It seems to work with a sleep 60 put in place. I guess it was just happening too fast. Now, just one more question. Being a linux noob, I am trying to rename a log file to a system date during a bash script. from rsync.log to 2011_10_14rsync.log or something similar to this. Should I do it in bash, or somewhere else? Can you suggest a good resource for scripting in bash? Quote Link to comment
tr0910 Posted October 17, 2011 Author Share Posted October 17, 2011 There is so much for examples out there that are way beyond my needs, but I might have answered my own question, thanks to this on google. Tested it and it seems to work. mv t1summary.log "`date +%Y%m%d_%H%M`_t1summary.logarchive" t1summary.log - becomes - 20111016_2141_t1summary.logarchive Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.