backups des homes sur une machine séparée
This commit is contained in:
parent
f62b563d0e
commit
803c1e8a4a
1 changed files with 31 additions and 30 deletions
|
@ -19,12 +19,15 @@ import backups
|
||||||
import os
|
import os
|
||||||
import pwd
|
import pwd
|
||||||
import grp
|
import grp
|
||||||
|
import socket
|
||||||
|
|
||||||
rootpath = "/etc/backuppc/"
|
rootpath = "/etc/backuppc/"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
root = pwd.getpwnam('root').pw_uid
|
root = pwd.getpwnam('root').pw_uid
|
||||||
wwwdata = grp.getgrnam("www-data").gr_gid
|
wwwdata = grp.getgrnam("www-data").gr_gid
|
||||||
|
|
||||||
|
if "babar" in socket.getfqdn():
|
||||||
for hoteRsync in backups.RsyncHosts:
|
for hoteRsync in backups.RsyncHosts:
|
||||||
backup_folders = backups.RsyncHostsToBackup[hoteRsync]
|
backup_folders = backups.RsyncHostsToBackup[hoteRsync]
|
||||||
backup_folders.update(backups.RsyncClassicalDirs)
|
backup_folders.update(backups.RsyncClassicalDirs)
|
||||||
|
@ -43,17 +46,15 @@ $Conf{FullPeriod} = %(full)s;""" % {'shares' : "', '".join(backup_folders.keys()
|
||||||
os.chmod(rootpath + hoteRsync + ".pl", 0644)
|
os.chmod(rootpath + hoteRsync + ".pl", 0644)
|
||||||
os.chown(rootpath + hoteRsync + ".pl", root, wwwdata)
|
os.chown(rootpath + hoteRsync + ".pl", root, wwwdata)
|
||||||
|
|
||||||
|
if "omnomnom" in socket.getfqdn():
|
||||||
for homeDir in backups.HomeHosts:
|
for homeDir in backups.HomeHosts:
|
||||||
with open(rootpath + "home-" + homeDir + ".pl", "w") as fichier:
|
with open(rootpath + "home-" + homeDir + ".pl", "w") as fichier:
|
||||||
fichier.write("""# Ces fichiers pointent vers zbee et servent à backuper les homes en séparé.
|
fichier.write("""# Ces fichiers servent à backuper les homes en séparé.
|
||||||
$Conf{ClientTimeout} = 86400;
|
$Conf{ClientTimeout} = 86400;
|
||||||
|
|
||||||
$Conf{XferMethod} = 'tar';
|
$Conf{XferMethod} = 'tar';
|
||||||
$Conf{TarShareName} = ['/home-adh/%(share)s'];
|
$Conf{TarShareName} = ['/home/%(share)s'];
|
||||||
$Conf{TarClientPath} = '/bin/tar';
|
$Conf{TarClientPath} = '/usr/bin/env LC_ALL=C sudo /usr/local/bin/backuppc_tar -v -f - -C $shareName';
|
||||||
$Conf{SshPath} = '/usr/bin/ssh';
|
|
||||||
|
|
||||||
$Conf{ClientNameAlias} = '%(myip)s';
|
|
||||||
|
|
||||||
$Conf{BackupFilesExclude} = {
|
$Conf{BackupFilesExclude} = {
|
||||||
'/home-adh/%(share)s' => ['lost+found'],
|
'/home-adh/%(share)s' => ['lost+found'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue