Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is my bash script:

Ok so simply, when I run the Bash command I get this error:

I really don't know why this is happening. Can anyone help? Thanks :)

This script is designed to restart the machine and will eventually be called via a Cron job, but this is unrelated and really only to allow ServerFault to post this question.

share|improve this question
You're going to restart a server via cron job? No, you don't want to do that. If you think you do, you should find and fix the real problem first. – Michael Hampton Jan 18 '14 at 5:57
I am running 20 Minecraft servers. This is two do two things - 1) Allow updates to the servers 2) Refresh resources. This type of thing isn't uncommon in this use case. Java is one memory hog. – user3106527 Jan 18 '14 at 7:05
Fine, so kill the java processes, let their memory be reclaimed. Rebooting the server to restart a process is like shooting someone to cure their cold. – MadHatter Jan 18 '14 at 9:32
@MadHatter Well, maybe he just hates his servers. I can think of a few people whom I'd recommend shooting as a cure to a cold. Or a hangnail. Or a mild itch. – HopelessN00b Jan 19 '14 at 8:48
up vote 9 down vote accepted

This is a trivial typo.

You have several lines which include:

`echo -ne '\015'\`

I presume you mean to embed a Ctrl-G bell character into the output.

The error is because you have placed an unnecessary backslash before the final backtick, thus escaping it. This isn't what you want.

Remove it:

`echo -ne '\015'`

Another thing: Get rid of this script entirely.

For starters, you really shouldn't be rebooting your server via a cron job. If you think you want to, you have another problem, which you should actually find and fix. Any reasonable server should be able to remain up and running for more than a day without intervention.

Second, the shutdown command will happily alert all logged on users (and screen sessions!) automatically. If you really must reboot, try using it to schedule your reboot.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.