Running Backup Scripts on Boot and Wake with systemd

If you’re running automated backups on a laptop, traditional schedulers like cron or fcron might not be ideal. Your machine isn’t always on, and you might want to trigger backups specifically when the system starts up or wakes from sleep. Here’s how to use systemd to run your backup script at these key moments. The systemd Service File Create /etc/systemd/system/backup.service: [Unit] Description=Run backup script at boot and wake-up After=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target [Service] Type=oneshot User=yourusername Group=yourgroup ExecStart=/path/to/backup-script.sh [Install] WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target The User and Group directives ensure the script runs as your user instead of root. This is important for: ...

July 31, 2024 · 2 min · 301 words

Getting Started with Ansible for Linux System Administration

Getting Started with Ansible for Linux System Administration System administration can be tedious and time-consuming, especially when managing multiple remote servers. Ansible provides a powerful solution for automating these tasks, making server management more efficient and less error-prone. Here’s how to set up Ansible and create your first playbooks for managing Linux servers. Key Concepts Ansible: An automation tool that uses YAML for defining configurations, making it human-readable and easy to manage. It operates over SSH, requiring no agents on remote systems. ...

April 2, 2024 · 3 min · 615 words

Mosh: The Mobile Shell - Userland Remote Access with Tailscale

Mosh (Mobile Shell) is a userland remote terminal application that provides resilient connections surviving network changes and interruptions. Unlike traditional system daemons, Mosh runs entirely in userspace, providing natural security boundaries and simplified deployment. How Mosh Works Userland Architecture Mosh operates entirely in userspace, which is fundamentally different from traditional SSH: Initial Connection Uses existing SSH for authentication SSH launches mosh-server as your user (not root) Server picks available UDP port Communicates port and key back through SSH Local mosh-client establishes UDP connection Security Benefits ...

February 15, 2024 · 5 min · 907 words