mysync/example/sync_config.py

28 lines
952 B
Python
Raw Normal View History

2020-01-26 17:13:41 +01:00
import os
import sys
backup = False
hosts = ['ahorn', 'erle', 'linde']
2021-01-16 09:19:21 +01:00
__basepath__ = '/usr/data'
2020-01-26 17:13:41 +01:00
entries = (
2021-01-16 09:19:21 +01:00
('dirk@%s:/usr/data', __basepath__, ['lost+found']),
('dirk@%s:/usr/data', __basepath__, ['lost+found', 'dirk/Audio', 'dirk/bin', 'dirk/Downloads', 'dirk/gnome-boxes', 'dirk/media_images', 'dirk/Videos']),
2020-01-26 17:13:41 +01:00
('dirk@%s:/home', '/home', None),
)
for host in hosts:
for remote, local, skip in entries:
2021-01-16 09:19:21 +01:00
name = os.path.basename(local)
2020-01-26 17:13:41 +01:00
if skip is not None:
2021-01-16 09:19:21 +01:00
if len(skip) > 1:
name += '_short'
setattr(sys.modules[__name__], host + '_' + name + '_skip', skip)
setattr(sys.modules[__name__], host + '_' + name + '_remotepath', remote % host)
setattr(sys.modules[__name__], host + '_' + name + '_localpath', local)
2020-01-26 17:13:41 +01:00
2021-01-16 09:19:21 +01:00
mount_mockery_audio_remotepath = 'root@mount-mockery.de:/data/audio'
mount_mockery_audio_localpath = os.path.join(__basepath__, 'dirk', 'Audio')