Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically run certain server commands at certain times #44

Closed
MilesBHuff opened this issue Feb 2, 2020 · 6 comments
Closed

Automatically run certain server commands at certain times #44

MilesBHuff opened this issue Feb 2, 2020 · 6 comments
Assignees
Labels
administration This ticket addresses server maintenance and changes. backups This ticket addresses server backups. feature This is a substantial change to intended behavior.

Comments

@MilesBHuff
Copy link
Member

It would be nice to be able to automatically run certain commands at certain times on the server. While we could look for a plugin to do this, it would be better if we could just pipe commands to the GNU screen that the server is running in; then, we could make any such automations part of cron.

In particular, I'd like the server to auto-restart once a day; and I'd like to refresh the Dynmap once a week.

@MilesBHuff MilesBHuff added the feature This is a substantial change to intended behavior. label Feb 2, 2020
@MilesBHuff MilesBHuff self-assigned this Feb 2, 2020
@MilesBHuff
Copy link
Member Author

I've figured out how to send commands to GNU screen, thanks to StackOverflow:
screen -S $SCREEN_NAME -X stuff "$COMMAND\n"

@MilesBHuff
Copy link
Member Author

MilesBHuff commented Feb 24, 2020

@krislamo This is the GitHub issue for what we talked about today (it already existed). ;)

@MilesBHuff
Copy link
Member Author

MilesBHuff commented Feb 24, 2020

@MilesBHuff MilesBHuff added the administration This ticket addresses server maintenance and changes. label Jun 22, 2020
@MilesBHuff MilesBHuff added the backups This ticket addresses server backups. label Jul 6, 2020
@MilesBHuff
Copy link
Member Author

MilesBHuff commented Apr 21, 2021

I should use systemd timers for this, instead of cron.

@MilesBHuff
Copy link
Member Author

MilesBHuff commented Jan 31, 2022

I finally implemented this! :D
I did it with cron, not systemd. Perhaps I should revisit that later.
Also, I didn't follow the plan from the Google doc. The most notable deviations are [1] no coordination with the backup server, and [2] the Minecraft server stays online during all of the maintenance, only restarting at the very end.
Anyways, here's the main commit: c24f64b

@MilesBHuff
Copy link
Member Author

I should use systemd timers for this, instead of cron.

New ticket opened for this: #201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
administration This ticket addresses server maintenance and changes. backups This ticket addresses server backups. feature This is a substantial change to intended behavior.
Projects
None yet
Development

No branches or pull requests

2 participants