This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Reboot a host and wait for it to return | |
| hosts: somehost | |
| remote_user: root | |
| tasks: | |
| # Send the reboot command | |
| - shell: shutdown -r now | |
| # This pause is mandatory, otherwise the existing control connection gets reused! | |
| - pause: seconds=30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Location to place backups. | |
| backup_dir="/var/backups/databases/" | |
| nightly_dir="/var/backups/databases/latest/" | |
| #String to append to the name of the backup files | |
| backup_date=`date +%d-%m-%Y` | |
| #Numbers of days you want to keep copie of your databases | |
| number_of_days=15 | |
| databases=`psql -l -t | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'` | |
| for i in $databases; do if [ "$i" != "postgres" ] && [ "$i" != "template0" ] && [ "$i" != "template1" ] && [ "$i" != "template_postgis" ]; then |
NewerOlder