Changes

From Amahi Wiki
Jump to: navigation, search
m
=== Automate ===
Backup and recovery can be automated in order to reduce the amount of manual command-line work required for these operations.
* A "root" user "cron job" could be created to perform backups at say "1:30 AM" everyday.<more information coming soonblockquote>root user "crontab" configuration:{{Text|Text=30 01 * * * /usr/bin/rsnapshot daily}}</blockquote> * Some system administrators will create a "nighttime backup script" cron job that is executed at say "1:30 AM" before a server is shutdown each night. <blockquote>root user "crontab" configuration:{{Text|Text=30 01 * * * /root/scripts/nighttime.bash}}</blockquote> <blockquote>root user "nighttime.bash" script:{{Code|nighttime.bash #!/bin/bash# Night time operations: Backup and Shutdown # Backup Dataecho "Backup Start: "$(date)/usr/bin/rsnapshot dailyecho "Backup Finished: "$(date)if [ "$?" -gt -1 ]then# Send shutdown message wall -n "$(date +%A) @ $(date +%T) system shutting down at scheduled time."# Shutdown System /sbin/shutdown -h nowfi}}</blockquote> * "bash" scripts could be written for restore, update, and update operations OR one combined script with command-line options written for all of these operations.
<br>