Oublis...

This commit is contained in:
Pierre-Elliott Bécue 2014-12-16 02:25:32 +01:00
parent 470227a2f4
commit 3c27d55ddd

View file

@ -35,12 +35,12 @@ if __name__ == "__main__":
backup_folders.pop(excluded) backup_folders.pop(excluded)
with open(rootpath + hoteRsync + ".pl", "w") as fichier: with open(rootpath + hoteRsync + ".pl", "w") as fichier:
fichier.write("""$Conf{RsyncShareName} = ['%(shares)s']; fichier.write("""$Conf{RsyncShareName} = ['%(shares)s'];
$Conf{BackupFilesExclude} = { $Conf{BackupFilesExclude} = {
%(excludes)s %(excludes)s
}; };
$Conf{IncrPeriod} = %(incr)s; $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]}) $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)
@ -50,14 +50,19 @@ if __name__ == "__main__":
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 servent à backuper les homes en séparé. fichier.write("""# Ces fichiers servent à backuper les homes en séparé.
$Conf{ClientTimeout} = 86400; $Conf{ClientNameAlias} = 'localhost';
$Conf{XferMethod} = 'tar';
$Conf{TarShareName} = ['/home/%(share)s'];
$Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C sudo /usr/local/bin/backuppc_tar -v -f - -C $shareName --totals';
$Conf{XferMethod} = 'tar'; $Conf{BackupFilesExclude} = {
$Conf{TarShareName} = ['/home/%(share)s']; '/home/%(share)s' => ['lost+found'],
$Conf{TarClientPath} = '/usr/bin/env LC_ALL=C sudo /usr/local/bin/backuppc_tar -v -f - -C $shareName'; };
$Conf{BackupFilesExclude} = { # remove extra shell escapes ($fileList+ etc.) that are
'/home-adh/%(share)s' => ['lost+found'], # needed for remote backups but may break local ones
};""" % {'share' : homeDir, 'myip' : backups.ipnfs}) $Conf{TarFullArgs} = '$fileList';
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList';
""" % {'share' : homeDir,})
os.chmod(rootpath + "home-" + homeDir + ".pl", 0644) os.chmod(rootpath + "home-" + homeDir + ".pl", 0644)
os.chown(rootpath + "home-" + homeDir + ".pl", root, wwwdata) os.chown(rootpath + "home-" + homeDir + ".pl", root, wwwdata)