A schedule runs one or more tasks at the times you choose. Open Schedules in the panel.
Example: restart the bot every night
- Press Create schedule.
- Give it a name, like Nightly restart.
- Set the time. The fields work like cron: for 05:00 every day, enter Minute
0, Hour5, and*in Day of Month, Month and Day of Week. - Leave Only When Server Is Online on, so a bot you stopped on purpose is not started again.
- Press Create schedule, then open the schedule and press New Task.
- Action: Send power action, then Restart. Save.
Times use the server clock, which runs on Central European Time (Europe/Berlin). 05:00 there is 04:00 in London and 23:00 the previous evening in New York.
Does a bot need a nightly restart? A well-behaved one does not. It is a reasonable patch for one that slowly uses more memory until it misbehaves, while you find out why.
Cron fields, briefly
*means every.*/15in Minute means every 15 minutes.1-5in Day of Week means Monday to Friday.0is Sunday.0Minute and*/6Hour means every six hours, on the hour.
Task types
- Send power action: start, stop, restart or kill.
- Send command: sends a line to the console, as if you typed it. With several bots on the server, this is how you restart or update one of them on a timer (below). Otherwise it goes to your program's input, which most bots do not read.
- Create backup: takes a backup. It uses one of your backup slots, and fails if all of them are full, so this is rarely worth it on top of the automatic daily backup. See Backups.
A schedule can have several tasks. Each has a Time offset in seconds after the previous one, which is how you would, say, stop the bot, wait, take a backup, then start it again. Tick Continue on Failure if later tasks should still run when an earlier one fails.
Restarting or updating one bot of several
With bots in the bots folder, a power action restarts all of them. To restart only one, use a Send command task with bots restart tickets (the folder's name in place of tickets); the others keep running. bots update tickets pulls that bot's newest commits first, when its .env has a GIT_REPO. Leave Only When Server Is Online on: the command needs the server running.
Testing a schedule
Open the schedule and press Run Now. The tasks run immediately, and the Activity page records it.
Something here wrong or out of date? Tell us and it gets fixed.