[backups] Modification des configurations
This commit is contained in:
parent
20a6ee6afb
commit
cc9d19f5c4
1 changed files with 10 additions and 10 deletions
|
@ -34,29 +34,29 @@ if __name__ == "__main__":
|
||||||
fichier.write("""$Conf{RsyncShareName} = ['%(shares)s'];
|
fichier.write("""$Conf{RsyncShareName} = ['%(shares)s'];
|
||||||
$Conf{BackupFilesExclude} = {
|
$Conf{BackupFilesExclude} = {
|
||||||
%(excludes)s
|
%(excludes)s
|
||||||
};""" % {'shares' : "', '".join(backup_folders.keys()), 'excludes' : "\n ".join(["'%s' => ['lost+found']," % nom for nom in backup_folders.keys()])})
|
};
|
||||||
|
|
||||||
|
$Conf{IncrPeriod} = %(incr)s;
|
||||||
|
$Conf{FullPeriod} = %(full)s;""" % {'shares' : "', '".join(backup_folders.keys()), 'excludes' : "\n ".join(["'%s' => ['lost+found']," % nom for nom in backup_folders.keys()]), 'incr': backups.RsyncPeriods[hoteRsync][0], 'full': backups.RsyncPeriods[hoteRsync][1]})
|
||||||
if backups.DumpPreUserCmd[hoteRsync]:
|
if backups.DumpPreUserCmd[hoteRsync]:
|
||||||
fichier.write("""\n$Conf{DumpPreUserCmd} = '%(dp)s';""" % {'dp':backups.DumpPreUserCmd[hoteRsync],})
|
fichier.write("""\n$Conf{DumpPreUserCmd} = '%(dp)s';""" % {'dp':backups.DumpPreUserCmd[hoteRsync],})
|
||||||
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)
|
||||||
|
|
||||||
for homeDir in backups.HomeHosts:
|
for homeDir in backups.HomeHosts:
|
||||||
with open(rootpath + 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 pointent vers zbee et servent à backuper les homes en séparé.
|
||||||
$Conf{ClientTimeout} = 86400;
|
$Conf{ClientTimeout} = 86400;
|
||||||
|
|
||||||
$Conf{XferMethod} = 'tar';
|
$Conf{XferMethod} = 'tar';
|
||||||
$Conf{TarShareName} = ['/home-adh'];
|
$Conf{TarShareName} = ['/home-adh/%(share)s'];
|
||||||
$Conf{TarClientPath} = '/bin/tar';
|
$Conf{TarClientPath} = '/bin/tar';
|
||||||
$Conf{SshPath} = '/usr/bin/ssh';
|
$Conf{SshPath} = '/usr/bin/ssh';
|
||||||
|
|
||||||
$Conf{ClientNameAlias} = '%(myip)s';
|
$Conf{ClientNameAlias} = '%(myip)s';
|
||||||
|
|
||||||
$Conf{BackupFilesExclude} = {
|
$Conf{BackupFilesExclude} = {
|
||||||
'/home-adh' => [
|
'/home-adh/%(share)s' => ['lost+found'],
|
||||||
'/lost+found',
|
};""" % {'share' : homeDir, 'myip' : backups.ipnfs})
|
||||||
'%(gimmemoar)s',
|
os.chmod(rootpath + "home-" + homeDir + ".pl", 0644)
|
||||||
],
|
os.chown(rootpath + "home-" + homeDir + ".pl", root, wwwdata)
|
||||||
};""" % {'gimmemoar' : "', '".join(backups.HomeExclude[homeDir]), 'myip':backups.ipnfs})
|
|
||||||
os.chmod(rootpath + homeDir + ".pl", 0644)
|
|
||||||
os.chown(rootpath + homeDir + ".pl", root, wwwdata)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue