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

I have tried to set up a scheduled backup of my Minecraft server. I used a script I found on GitHub at frdmn/ and it seems to work great when I run it from the terminal directly.

The cronjobs I have set up however doesn't work for some reason. In mails I get these error messages:

Hexxit Server is running, suspending saves... su: must be run from a terminal
su: must be run from a terminal
su: must be run from a terminal
Backing up hexxit-01... done
Total backup size (175 MiB) <= (5000 MiB)... done
Hexxit Server is running, re-enabling saves... su: must be run from a terminal
su: must be run from a terminal

The main problem seems to be su: must be run from a terminal and I assume this has to do with security issues on the server and not the script, so that's why I'm asking here.

It's more or less a freshly installed instance of Debian 7.1.0 x64 with one user on it, mc. How do I fix it so that this script runs successfully?

The cronjobs look like this and have been added using crontab -e

*/15 * * * * /usr/bin/minebackup backup
0 0 * * * /usr/bin/minebackup backup full

I've been searching around for a bit and I have a feeling I need to edit /etc/sudoers, but the line which I was supposed to comment away isn't even in the file, so I don't know if Debian has changed its defaults or... eh?

Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

root    ALL=(ALL:ALL) ALL

%sudo   ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d
share|improve this question

marked as duplicate by Jenny D, Dave M, mdpc, Ward, Falcon Momot Oct 8 '13 at 5:45

This question was marked as an exact duplicate of an existing question.

try editing /etc/sudoers using visudo and comment out:

Defaults    requiretty
share|improve this answer
That's what I read other places, and the problem is that there is no such line to comment out. – Svish Oct 8 '13 at 8:37
then just try adding Defaults !requiretty – Doug Oct 8 '13 at 17:19

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