Tool to sync or backup data
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

sync_config.py 952B

123456789101112131415161718192021222324252627
  1. import os
  2. import sys
  3. backup = False
  4. hosts = ['ahorn', 'erle', 'linde']
  5. __basepath__ = '/usr/data'
  6. entries = (
  7. ('dirk@%s:/usr/data', __basepath__, ['lost+found']),
  8. ('dirk@%s:/usr/data', __basepath__, ['lost+found', 'dirk/Audio', 'dirk/bin', 'dirk/Downloads', 'dirk/gnome-boxes', 'dirk/media_images', 'dirk/Videos']),
  9. ('dirk@%s:/home', '/home', None),
  10. )
  11. for host in hosts:
  12. for remote, local, skip in entries:
  13. name = os.path.basename(local)
  14. if skip is not None:
  15. if len(skip) > 1:
  16. name += '_short'
  17. setattr(sys.modules[__name__], host + '_' + name + '_skip', skip)
  18. setattr(sys.modules[__name__], host + '_' + name + '_remotepath', remote % host)
  19. setattr(sys.modules[__name__], host + '_' + name + '_localpath', local)
  20. mount_mockery_audio_remotepath = 'root@mount-mockery.de:/data/audio'
  21. mount_mockery_audio_localpath = os.path.join(__basepath__, 'dirk', 'Audio')