mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-04 12:12:23 +08:00
Adjust gnome-backups to use lock-wrapper
This commit is contained in:
@@ -1,15 +1,4 @@
|
||||
#!/bin/bash
|
||||
LOCKFILE=/fedora_backups/gnome/backup.lock
|
||||
|
||||
if [ -f $LOCKFILE ];
|
||||
then
|
||||
quit "Lockfile exists.. Remove $LOCKFILE"
|
||||
else
|
||||
echo $$ > $LOCKFILE
|
||||
# Make VERY sure the lock file is made
|
||||
touch $LOCKFILE || exit
|
||||
fi
|
||||
|
||||
# backup.sh will run FROM backup03 TO the various GNOME boxes on the set. (there's two set
|
||||
# of machines, one being the ones with a public IP and the others being the IP-less ones that
|
||||
# will forward their agent through bastion.gnome.org)
|
||||
|
||||
@@ -31,16 +31,22 @@
|
||||
|
||||
- name: Create GNOME backup user
|
||||
user: name=gnomebackup state=present home=/fedora_backups/gnome/ createhome=yes shell=/sbin/nologin
|
||||
|
||||
- name: Add a Directory for the Excludes list
|
||||
file: dest=/fedora/backups/gnome/excludes owner=gnomebackup group=gnomebackup state=directory
|
||||
|
||||
- name: Add a Directory for the Log files
|
||||
file: dest=/fedora_backups/gnome/logs owner=gnomebackup group=gnomebackup state=directory
|
||||
|
||||
- name: Install GNOME backup key
|
||||
copy: src=${private}/files/gnome/backup_id.rsa dest=/usr/local/etc/gnome_backup_id.rsa mode=0600 owner=gnomebackup
|
||||
|
||||
- name: Install GNOME backup script
|
||||
copy: src=$files/gnome/backup.sh dest=/usr/local/bin/gnome_backup mode=0700 owner=gnomebackup
|
||||
|
||||
- name: Schedule the GNOME backup script
|
||||
cron: name="Backup" hour=5 minute=0 job="(cd /fedora_backups/gnome/; /usr/local/bin/gnome_backup)" user=gnomebackup
|
||||
cron: name="Backup" hour=5 minute=0 job="(cd /fedora_backups/gnome/; /usr/local/bin/lock-wrapper gnomebackup /usr/local/bin/gnome_backup)" user=gnomebackup
|
||||
|
||||
- name: Add Directories
|
||||
file: dest=/fedora_backups/gnome/{{ item }} owner=gnomebackup group=gnomebackup state=directory
|
||||
with_items:
|
||||
|
||||
Reference in New Issue
Block a user