Install crond on the server and enable it.

This commit is contained in:
Alex Pickering 2024-05-02 20:50:39 -05:00
parent 22de5974ae
commit 3634220ff5
4 changed files with 10 additions and 5 deletions

View File

@ -14,8 +14,8 @@ local config = {
version="0.0.1",
bucket_name="txweaboo", --aws s3 bucket, created manually to prevent terraform from trying to delete it.
instance_name="Weaboos Anonymous", -- Name to use for the multimc instance
server_starts="1 16 * * 1,4", --Starts at 4pm on Mondays and Thursdays
server_stops="1 1 * * 2,5", --Server stops at 1am on Tuesdays and Fridays
server_starts="1 11 * * 1,4", --Starts at 4pm on Mondays and Thursdays
server_stops="1 19 * * 1,4", --Server stops at 1am on Tuesdays and Fridays
}
-- Each machine gets a startup script, located in src/startup that configures

View File

@ -19,6 +19,7 @@
var stops_sched = "<%- config.server_stops %>";
var starts = later.parse.cron(starts_sched);
var stops = later.parse.cron(stops_sched);
var offset = -(new Date().getTimezoneOffset() / 60)
var cronstrue;
var soon_el, starts_el, stops_el;
@ -42,8 +43,8 @@
soon_el = document.getElementById("soon");
starts_el = document.getElementById("starts");
stops_el = document.getElementById("stops");
starts_el.innerText = cronstrue.toString(starts_sched);
stops_el.innerText = cronstrue.toString(stops_sched);
starts_el.innerText = cronstrue.toString(starts_sched, {"tzOffset": offset});
stops_el.innerText = cronstrue.toString(stops_sched, {"tzOffset": offset});
set_timer();
});

View File

@ -13,7 +13,7 @@ aws configure set aws_secret_access_key "<%- secrets.aws.secret_key %>"
mkdir /mnt
mount /dev/sdf /mnt
sudo yum install java-17-amazon-corretto-devel -y
sudo yum install cronie java-17-amazon-corretto-devel -y
cd /mnt
# Download the dedicated server if we don't have it
@ -74,3 +74,5 @@ cat > cronfile <<EOF
1 * * * * aws s3 sync /mnt/backups/world/differential s3://<%- config.bucket_name %>/backup
EOF
crontab cronfile
service crond start
systemctl enable crond

View File

@ -98,3 +98,5 @@ cat > cronfile <<EOF
<%- config.server_stops %> /root/stop.sh
EOF
crontab cronfile
service crond start
systemctl enable crond