So... I can't find any reason for this, but I'm sure someone has.
I've setup a container that does some backup stuff from Github. It worked fine in Linode, and it was running a simple cron to trigger the script.
But I cannot for the life of me get it working within an LXC container. I've tried with cronie and system timers and the thing refuses to run.
It's fully pathed, but is there something I'm missing that enables scheduled events to run in a container? They just won't fire.
Here's what I've tried:
And systemd timers:
Losing my mind here
I've setup a container that does some backup stuff from Github. It worked fine in Linode, and it was running a simple cron to trigger the script.
But I cannot for the life of me get it working within an LXC container. I've tried with cronie and system timers and the thing refuses to run.
It's fully pathed, but is there something I'm missing that enables scheduled events to run in a container? They just won't fire.
Here's what I've tried:
Code:
1 22 * * 1-6 root /usr/bin/tmux new-session -d -s gh-bk-daily '/bin/bash /usr/local/bin/github-backup-daily' 2>&1 >> /var/log/gh-backup-daily.log
0 22 * * 0 root /usr/bin/tmux new-session -d -s gh-bk-weekly '/bin/bash /usr/local/bin/github-backup-weekly' 2>&1 >> /var/log/gh-backup-weekly.log
And systemd timers:
Code:
# /etc/systemd/system/github-daily.timer
[Unit]
Description="Run github-backup-daily every 6 days a week at 22:00"
[Timer]
OnBootSec=5min
OnUnitActiveSec=24h
OnCalendar=Mon..Sat *-*-* 22:00:*
Unit=github-daily.service
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/github-daily.service
[Unit]
Description="Github Daily Backup"
[Service]
ExecStart=/usr/local/bin/tmux-github-daily
Losing my mind here