Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have tried to set up a scheduled backup of my Minecraft server. I used a script I found on GitHub at frdmn/minebackup.sh 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
done
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
done

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

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.