french_guy Posted December 12, 2012 Share Posted December 12, 2012 Hello I did install a new hard drive, with a preclear Since my server was programmed to shut down every night at 11:45pm, I've put the "#" sign just before the echo line For the preclear, i installed screen thru package manager. And when I access the go file again to remove the # once the preclear was done, it looks like this: #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz /boot/unmenu/uu echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c Is this normal? Link to comment
french_guy Posted December 12, 2012 Author Share Posted December 12, 2012 1 more quick comment: When I opened the go file with the Note pad application, the last line was as follow: echo "/sbin/powerdown" | at 23:45cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c Sounds weird.... And when I copied/paste to post in the forum, it appeared like that: echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c So I saved the go file with those 2 lines, and not as it was with only 1 line Is it OK? Link to comment
trurl Posted December 12, 2012 Share Posted December 12, 2012 ...When I opened the go file with the Note pad application... If you mean Windows Notepad, you should never use that to work with Linux files. Notepad++, Textpad, I'm sure there are others. Windows uses CR/LF for end-of-line and Linux just uses LF. If you do CR/LF it will usually break something. Link to comment
french_guy Posted December 12, 2012 Author Share Posted December 12, 2012 Arghhh.....Yes, it was Windows Notepad So what should I do if my server doesn't start properly? I will have to dig in some old posts, because I think Joe.L said it was OK for the go file to use NotePad (but again I am not sure, I will have to search) Link to comment
Joe L. Posted December 12, 2012 Share Posted December 12, 2012 Arghhh.....Yes, it was Windows Notepad So what should I do if my server doesn't start properly? I will have to dig in some old posts, because I think Joe.L said it was OK for the go file to use NotePad (but again I am not sure, I will have to search) It is perfectly fine to use ANY editor on the config/go file. It is processed through "fromdos" prior to being executed. It is never executed directly. That is not true with many other of the Linux configuration files, as most are not processed prior to use. Joe L. Link to comment
Joe L. Posted December 12, 2012 Share Posted December 12, 2012 1 more quick comment: When I opened the go file with the Note pad application, the last line was as follow: echo "/sbin/powerdown" | at 23:45cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c Sounds weird.... And when I copied/paste to post in the forum, it appeared like that: echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c So I saved the go file with those 2 lines, and not as it was with only 1 line Is it OK? It should be two lines. Link to comment
french_guy Posted December 12, 2012 Author Share Posted December 12, 2012 OK, this is how I saved the go file before shutting down the server (2 lines) Will see tonight if it starts properlly, and if it shuts down properlly as well at 23:45 Thanks Link to comment
Joe L. Posted December 12, 2012 Share Posted December 12, 2012 OK, this is how I saved the go file before shutting down the server (2 lines) Will see tonight if it starts properlly, and if it shuts down properlly as well at 23:45 Thanks You can type: atq to see the at "queue" Link to comment
french_guy Posted December 13, 2012 Author Share Posted December 13, 2012 Well, with the go file as follow, the server didn't shut down at 23:45 #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz /boot/unmenu/uu echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c 1 remark though: When I open it with Note Pad, I can't see the extra blank line between echo and cd /boot. This blank line only appears when I paste Anyway, before having that extra line "cd /boot/etc.....my server was shutting down every time a 23:45 What should i change? Is the blank line the problem? Should I edit with another editor? Link to comment
Joe L. Posted December 13, 2012 Share Posted December 13, 2012 Well, with the go file as follow, the server didn't shut down at 23:45 #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz /boot/unmenu/uu echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c 1 remark though: When I open it with Note Pad, I can't see the extra blank line between echo and cd /boot. This blank line only appears when I paste Anyway, before having that extra line "cd /boot/etc.....my server was shutting down every time a 23:45 What should i change? Is the blank line the problem? Should I edit with another editor? Editing the file DOES NOT do anything to schedule a shutdown. The only time that "go file is invoked is if you reboot. TO see if the shutdown command is in the "at" queue , type atq You can do that now, and then reboot and type it again, it should be there after a reboot. Blank lines in the "go" file have no effect. There is no issue with them there. Link to comment
french_guy Posted December 13, 2012 Author Share Posted December 13, 2012 OK, I will try tonight. But right after I added "Screen" with package manager to preclear my new disk, the go file was looking like that with Note Pad #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz /boot/unmenu/uu echo "/sbin/powerdown" | at 23:45cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c But when i did a copy/paste to post in the forum, it was like that #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz /boot/unmenu/uu echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c Link to comment
trurl Posted December 13, 2012 Share Posted December 13, 2012 Notepad expects a CR/LF to indicate a newline. There was probably only a LF between "23:45" and "cd" so no newline as far as Notepad is concerned. Even though JoeL said you could edit go with Notepad, you really should start using a Linux compatible editor because you will want to edit something else in the future on your unRAID and it will not work. You will save yourself a lot of trouble and more questions in the long run. Search for Notepad++. It's free. Link to comment
french_guy Posted December 14, 2012 Author Share Posted December 14, 2012 Well, with the go file as follow, the server didn't shut down at 23:45 #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz /boot/unmenu/uu echo "/sbin/powerdown" | at 23:45 cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c Where should I type the atq command? 1 remark though: When I open it with Note Pad, I can't see the extra blank line between echo and cd /boot. This blank line only appears when I paste Anyway, before having that extra line "cd /boot/etc.....my server was shutting down every time a 23:45 What should i change? Is the blank line the problem? Should I edit with another editor? Editing the file DOES NOT do anything to schedule a shutdown. The only time that "go file is invoked is if you reboot. TO see if the shutdown command is in the "at" queue , type atq You can do that now, and then reboot and type it again, it should be there after a reboot. Blank lines in the "go" file have no effect. There is no issue with them there. Link to comment
french_guy Posted December 14, 2012 Author Share Posted December 14, 2012 When I do cd /boot atq I receive this: root@Tower:/boot# atq 1 Fri Dec 14 23:45:00 2012 a root Why Friday Dec 14? We are Thursday Dec 13 and my server should stop tonight at 23:45, not tomorrow !!! Link to comment
Joe L. Posted December 14, 2012 Share Posted December 14, 2012 When I do cd /boot atq I receive this: root@Tower:/boot# atq 1 Fri Dec 14 23:45:00 2012 a root Why Friday Dec 14? We are Thursday Dec 13 and my server should stop tonight at 23:45, not tomorrow !!! Since we have absolutely no idea how you have the system time-zone, date and time set, we cannot answer. Type date to see the current date/time Link to comment
french_guy Posted December 15, 2012 Author Share Posted December 15, 2012 Found it... There was an error on my date and time Don't know why Now, it's working fine Thanks Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.