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)
with open(rootpath + hoteRsync + ".pl", "w") as fichier:
fichier.write("""$Conf{RsyncShareName} = ['%(shares)s'];
$Conf{BackupFilesExclude} = {
%(excludes)s
};
$Conf{BackupFilesExclude} = {
%(excludes)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{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]:
fichier.write("""\n$Conf{DumpPreUserCmd} = '%(dp)s';""" % {'dp':backups.DumpPreUserCmd[hoteRsync],})
os.chmod(rootpath + hoteRsync + ".pl", 0644)
@ -50,14 +50,19 @@ if __name__ == "__main__":
for homeDir in backups.HomeHosts:
with open(rootpath + "home-" + homeDir + ".pl", "w") as fichier:
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{TarShareName} = ['/home/%(share)s'];
$Conf{TarClientPath} = '/usr/bin/env LC_ALL=C sudo /usr/local/bin/backuppc_tar -v -f - -C $shareName';
$Conf{BackupFilesExclude} = {
'/home/%(share)s' => ['lost+found'],
};
$Conf{BackupFilesExclude} = {
'/home-adh/%(share)s' => ['lost+found'],
};""" % {'share' : homeDir, 'myip' : backups.ipnfs})
# remove extra shell escapes ($fileList+ etc.) that are
# needed for remote backups but may break local ones
$Conf{TarFullArgs} = '$fileList';
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList';
""" % {'share' : homeDir,})
os.chmod(rootpath + "home-" + homeDir + ".pl", 0644)
os.chown(rootpath + "home-" + homeDir + ".pl", root, wwwdata)