[backuppc] On permute le lien symbolique et le fichier
This commit is contained in:
parent
8578f58223
commit
777a0b1d7c
2 changed files with 141 additions and 138 deletions
|
@ -1 +0,0 @@
|
||||||
../../../../../etc/python/backups.py
|
|
140
Cfg/etc/backuppc/config/backups.py/backups.py
Normal file
140
Cfg/etc/backuppc/config/backups.py/backups.py
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
#/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Fichier python de gestion des backups
|
||||||
|
#
|
||||||
|
# Auteur : Pierre-Elliott Bécue <becue@crans.org>
|
||||||
|
# Licence : GPLv3
|
||||||
|
#
|
||||||
|
# Ce fichier de config est écrit dans ~bcfg2/Cfg/etc/backuppc/config/
|
||||||
|
# backups.py/backups.py
|
||||||
|
#
|
||||||
|
# Il sert de config dans le plugin python pour rsyncd.conf et backuppc/hosts
|
||||||
|
# et il est dupliqué sur babar
|
||||||
|
#
|
||||||
|
# Ne faites jamais include("backups") dans ce fichier !
|
||||||
|
# Le cas échéant, vous allez faire un include cyclique (l'un des deux
|
||||||
|
# est un lien symbolique de l'autre).
|
||||||
|
|
||||||
|
import collections
|
||||||
|
|
||||||
|
# Liste des hosts, pourrait éventuellement être calculée au runtime
|
||||||
|
# via les MetaData
|
||||||
|
RsyncHosts = [
|
||||||
|
"asterisk",
|
||||||
|
"babar",
|
||||||
|
"baldrick",
|
||||||
|
"bcfg2",
|
||||||
|
"cas",
|
||||||
|
"charybde",
|
||||||
|
"dhcp",
|
||||||
|
"eap",
|
||||||
|
"ethercalc",
|
||||||
|
'ft',
|
||||||
|
'fz',
|
||||||
|
"geet",
|
||||||
|
"horde",
|
||||||
|
"irc",
|
||||||
|
"isc",
|
||||||
|
"kdell",
|
||||||
|
"kenobi",
|
||||||
|
"komaz",
|
||||||
|
"nat64",
|
||||||
|
"nem",
|
||||||
|
"news",
|
||||||
|
"niomniom",
|
||||||
|
"o2",
|
||||||
|
"owl",
|
||||||
|
"pea",
|
||||||
|
"radius",
|
||||||
|
"redisdead",
|
||||||
|
"rezosup",
|
||||||
|
"roundcube",
|
||||||
|
"routeur",
|
||||||
|
"sable",
|
||||||
|
"sogo",
|
||||||
|
"thot",
|
||||||
|
"titanic",
|
||||||
|
"tracker",
|
||||||
|
"vert",
|
||||||
|
# "vo", trop de bordel, rien de critique
|
||||||
|
"xmpp",
|
||||||
|
"ytrap-llatsni",
|
||||||
|
"zamok",
|
||||||
|
"zbee",
|
||||||
|
]
|
||||||
|
|
||||||
|
# RsyncHostsToBackup : dictionnaire d'hôtes de la forme
|
||||||
|
# { "hote" : {
|
||||||
|
# 'nomdepartochecool' : 'emplacement de partoche cool',
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# Configs courantes pour les partitions à copier
|
||||||
|
RsyncClassicalDirs = {
|
||||||
|
'slash' : '/',
|
||||||
|
'var' : '/var',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Configs spécifiques des partitions à copier pour chaque hôte
|
||||||
|
# copié par rsync
|
||||||
|
RsyncHostsToBackup = collections.defaultdict(dict)
|
||||||
|
|
||||||
|
RsyncHostsToBackup['ft'] = {
|
||||||
|
'pve' : '/etc/pve',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['fz'] = {
|
||||||
|
'pve' : '/etc/pve',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['geet'] = {
|
||||||
|
'git' : '/git',
|
||||||
|
'gitlab' : '/gitlab',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['kdell'] = {
|
||||||
|
'pve' : '/etc/pve',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['news'] = {
|
||||||
|
'news-spool' : '/var/spool/news',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['niomniom'] = {
|
||||||
|
'www' : '/var/local',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['redisdead'] = {
|
||||||
|
'mailman' : '/var/lib/mailman',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['thot'] = {
|
||||||
|
'boot' : '/boot',
|
||||||
|
}
|
||||||
|
|
||||||
|
RsyncHostsToBackup['zamok'] = {
|
||||||
|
'boot' : '/boot',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Certaines machines n'ont pas de /var à part.
|
||||||
|
# On vire avec ce dico
|
||||||
|
RsyncHostsToExclude = collections.defaultdict(list)
|
||||||
|
|
||||||
|
RsyncHostsToExclude["asterisk"] = [
|
||||||
|
"var",
|
||||||
|
]
|
||||||
|
RsyncHostsToExclude["dhcp"] = [
|
||||||
|
"var",
|
||||||
|
]
|
||||||
|
RsyncHostsToExclude["ytrap-llatsni"] = [
|
||||||
|
"var",
|
||||||
|
]
|
||||||
|
|
||||||
|
ipnfs = '10.231.136.7'
|
||||||
|
|
||||||
|
# Génération des 26 partitions de backup pour les homes.
|
||||||
|
HomeHosts = ["home-" + lettre for lettre in map(chr, range(97, 123))]
|
||||||
|
|
||||||
|
# Oui, c'est gore, vu que /home n'est qu'une seule partition physique,
|
||||||
|
# il faut enlever à la main chaque lettre de l'alphabet. :'(
|
||||||
|
HomeExclude = { "home-" + lettre : [ "/" + caractere + "*" for caractere in map(chr, range(97, 123)) if caractere != lettre] for lettre in map(chr, range(97, 123))}
|
|
@ -1,137 +0,0 @@
|
||||||
#/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# Fichier python de gestion des backups
|
|
||||||
#
|
|
||||||
# Auteur : Pierre-Elliott Bécue <becue@crans.org>
|
|
||||||
# Licence : GPLv3
|
|
||||||
#
|
|
||||||
# Ce fichier de config est écrit dans ~bcfg2/Cfg/etc/backuppc/config/
|
|
||||||
# backups.py/backups.py
|
|
||||||
#
|
|
||||||
# Ne faites jamais include("backups") dans ce fichier !
|
|
||||||
# Le cas échéant, vous allez faire un include cyclique (l'un des deux
|
|
||||||
# est un lien symbolique de l'autre).
|
|
||||||
|
|
||||||
import collections
|
|
||||||
|
|
||||||
# Liste des hosts, pourrait éventuellement être calculée au runtime
|
|
||||||
# via les MetaData
|
|
||||||
RsyncHosts = [
|
|
||||||
"asterisk",
|
|
||||||
"babar",
|
|
||||||
"baldrick",
|
|
||||||
"bcfg2",
|
|
||||||
"cas",
|
|
||||||
"charybde",
|
|
||||||
"dhcp",
|
|
||||||
"eap",
|
|
||||||
"ethercalc",
|
|
||||||
'ft',
|
|
||||||
'fz',
|
|
||||||
"geet",
|
|
||||||
"horde",
|
|
||||||
"irc",
|
|
||||||
"isc",
|
|
||||||
"kdell",
|
|
||||||
"kenobi",
|
|
||||||
"komaz",
|
|
||||||
"nat64",
|
|
||||||
"nem",
|
|
||||||
"news",
|
|
||||||
"niomniom",
|
|
||||||
"o2",
|
|
||||||
"owl",
|
|
||||||
"pea",
|
|
||||||
"radius",
|
|
||||||
"redisdead",
|
|
||||||
"rezosup",
|
|
||||||
"roundcube",
|
|
||||||
"routeur",
|
|
||||||
"sable",
|
|
||||||
"sogo",
|
|
||||||
"thot",
|
|
||||||
"titanic",
|
|
||||||
"tracker",
|
|
||||||
"vert",
|
|
||||||
# "vo", trop de bordel, rien de critique
|
|
||||||
"xmpp",
|
|
||||||
"ytrap-llatsni",
|
|
||||||
"zamok",
|
|
||||||
"zbee",
|
|
||||||
]
|
|
||||||
|
|
||||||
# RsyncHostsToBackup : dictionnaire d'hôtes de la forme
|
|
||||||
# { "hote" : {
|
|
||||||
# 'nomdepartochecool' : 'emplacement de partoche cool',
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# Configs courantes pour les partitions à copier
|
|
||||||
RsyncClassicalDirs = {
|
|
||||||
'slash' : '/',
|
|
||||||
'var' : '/var',
|
|
||||||
}
|
|
||||||
|
|
||||||
# Configs spécifiques des partitions à copier pour chaque hôte
|
|
||||||
# copié par rsync
|
|
||||||
RsyncHostsToBackup = collections.defaultdict(dict)
|
|
||||||
|
|
||||||
RsyncHostsToBackup['ft'] = {
|
|
||||||
'pve' : '/etc/pve',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['fz'] = {
|
|
||||||
'pve' : '/etc/pve',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['geet'] = {
|
|
||||||
'git' : '/git',
|
|
||||||
'gitlab' : '/gitlab',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['kdell'] = {
|
|
||||||
'pve' : '/etc/pve',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['news'] = {
|
|
||||||
'news-spool' : '/var/spool/news',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['niomniom'] = {
|
|
||||||
'www' : '/var/local',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['redisdead'] = {
|
|
||||||
'mailman' : '/var/lib/mailman',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['thot'] = {
|
|
||||||
'boot' : '/boot',
|
|
||||||
}
|
|
||||||
|
|
||||||
RsyncHostsToBackup['zamok'] = {
|
|
||||||
'boot' : '/boot',
|
|
||||||
}
|
|
||||||
|
|
||||||
# Certaines machines n'ont pas de /var à part.
|
|
||||||
# On vire avec ce dico
|
|
||||||
RsyncHostsToExclude = collections.defaultdict(list)
|
|
||||||
|
|
||||||
RsyncHostsToExclude["asterisk"] = [
|
|
||||||
"var",
|
|
||||||
]
|
|
||||||
RsyncHostsToExclude["dhcp"] = [
|
|
||||||
"var",
|
|
||||||
]
|
|
||||||
RsyncHostsToExclude["ytrap-llatsni"] = [
|
|
||||||
"var",
|
|
||||||
]
|
|
||||||
|
|
||||||
ipnfs = '10.231.136.7'
|
|
||||||
|
|
||||||
# Génération des 26 partitions de backup pour les homes.
|
|
||||||
HomeHosts = ["home-" + lettre for lettre in map(chr, range(97, 123))]
|
|
||||||
|
|
||||||
# Oui, c'est gore, vu que /home n'est qu'une seule partition physique,
|
|
||||||
# il faut enlever à la main chaque lettre de l'alphabet. :'(
|
|
||||||
HomeExclude = { "home-" + lettre : [ "/" + caractere + "*" for caractere in map(chr, range(97, 123)) if caractere != lettre] for lettre in map(chr, range(97, 123))}
|
|
1
etc/python/backups.py
Symbolic link
1
etc/python/backups.py
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../Cfg/etc/backuppc/config/backups.py/backups.py
|
Loading…
Add table
Add a link
Reference in a new issue