I know this is a relatively simple issue to solve. Though I think its a bit of an oversight that its not in the documentation.
Cron
crontab -e <<'EOF'
15 3 * * * /usr/bin/flatpak update -y --noninteractive >>"$HOME/flatpak-update.log" 2>&1
EOF
Systemd Timers
#!/usr/bin/env bash
set -euo pipefail
SERVICE_DIR="${HOME}/.config/systemd/user"
mkdir -p "$SERVICE_DIR"
cat >"$SERVICE_DIR/flatpak-update.service" <<'EOF'
[Unit]
Description=Daily Flatpak update (user)
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak update -y --noninteractive
EOF
cat >"$SERVICE_DIR/flatpak-update.timer" <<'EOF'
[Unit]
Description=Run Flatpak update daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now flatpak-update.timer
systemctl --user list-timers --all | sed -n '1,5p'
Potantial issues:
I would think it would be bad if an update and flatpak install ran at the same time, does that flatpak binary check a lock file or something similar before updating or installing??
I know this is a relatively simple issue to solve. Though I think its a bit of an oversight that its not in the documentation.
Cron
Systemd Timers
Potantial issues:
I would think it would be bad if an update and flatpak install ran at the same time, does that flatpak binary check a lock file or something similar before updating or installing??