rsync sync servers with checksum and delete

How do I keep /var/www identical on two servers with minimal transfer?

Try: rsync -avz --checksum --delete /var/www/ linuxteck@backup:/var/www/ Info: --checksum compares file contents rather than timestamps to catch true changes. --delete removes destination files that no longer exist on the source. Examples: $ rsync -avz --dry-run /src/ user@host:/dst/  # Dry-run preview $ rsync -avz --exclude='*.log' --exclude='cache/' /src/ /dst/ $ rsync -avz --link-dest=/prev/backup […]

Read More
systemd-run resource limits for CPU and memory

How do I prevent a runaway script from consuming all resources?

Try: systemd-run --scope -p CPUQuota=25% -p MemoryMax=500M ./heavy_script.sh Info: systemd-run creates a transient cgroup with resource limits. Any process launched inside respects those limits. Great for testing or running untrusted code. Examples: $ systemd-run --scope -p CPUQuota=50% stress --cpu 8 $ systemd-run --user -p MemoryMax=1G firefox $ systemd-run --scope -p IOWeight=10 […]

Read More