sync
This commit is contained in:
parent
a0b41d168a
commit
e73fac2d0a
2 changed files with 111 additions and 0 deletions
64
sync.py
Executable file
64
sync.py
Executable file
|
@ -0,0 +1,64 @@
|
|||
#! /usr/bin/env python3
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import pubnix
|
||||
|
||||
ARGS = [
|
||||
{'dn':'aussies.space', 'sub': False},
|
||||
{'dn':'blinkenshell.org',
|
||||
'ssh': 'ssh', 'port': 2222, 'web': 'u', 'sub': True},
|
||||
{'dn':'ctrl-c.club', 'sub': False},
|
||||
{'dn':'dimension.sh', 'sub': True},
|
||||
{'dn':'envs.net', 'sub': True},
|
||||
{'dn':'fr.tild3.org', 'sub': True},
|
||||
{'dn':'heathens.club', 'root': 'www', 'sub': False},
|
||||
{'dn':'insomnia247.nl', 'dir': True, 'sub': True},
|
||||
{'dn':'remotes.club', 'port': 9022, 'root': 'web', 'sub': True},
|
||||
{'dn':'rw.rs', 'sub': False},
|
||||
{'dn':'squiggle.city', 'sub': False},
|
||||
{'dn':'thunix.net', 'sub': False},
|
||||
{'dn':'tilde.cafe', 'sub': True},
|
||||
{'dn':'tilde.club', 'sub': False},
|
||||
{'dn':'tilde.fun', 'root': 'html', 'sub': False},
|
||||
{'dn':'tilde.guru', 'sub': False},
|
||||
{'dn':'tilde.institute', 'sub': True},
|
||||
{'dn':'tilde.pink', 'sub': False},
|
||||
{'dn':'tilde.team', 'sub': True},
|
||||
{'dn':'tilde.town', 'sub': False},
|
||||
{'dn':'sdf.org', 'root': 'html', 'sub': True},
|
||||
{'dn':'southlondon.cc', 'sub': False},
|
||||
]
|
||||
PUBNIXES = [pubnix.PubNix(**args) for args in ARGS]
|
||||
|
||||
|
||||
def sync(root, pubnix, exclude=None):
|
||||
args = [
|
||||
'rsync',
|
||||
'--archive',
|
||||
'--checksum',
|
||||
'--delete-before',
|
||||
'--rsh', f"ssh -o 'LogLevel Error' -p {pubnix.port}",
|
||||
'--partial',
|
||||
'--progress',
|
||||
'--verbose',
|
||||
os.path.join(root, str()),
|
||||
]
|
||||
for item in exclude:
|
||||
args.extend(['--exclude', os.path.join(str(), item)])
|
||||
args.append(os.path.join(pubnix.target, str()))
|
||||
subprocess.call(args, stdout=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def main():
|
||||
root = os.path.dirname(os.path.realpath(__file__))
|
||||
for pubnix in PUBNIXES:
|
||||
print()
|
||||
print(pubnix)
|
||||
sync(root, pubnix, exclude=['__pycache__', 'cnam', 'pgp.asc'])
|
||||
# pubnix.disk_free()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue