launched service: rysnc w/ excludes.txt
This commit is contained in:
7
conf/rsync-conf/excludes.txt
Normal file
7
conf/rsync-conf/excludes.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
*.tmp
|
||||||
|
*.log
|
||||||
|
cache/
|
||||||
|
temp/
|
||||||
|
*.lock
|
||||||
|
lost+found/
|
||||||
|
traefik/certificates/acme.json
|
||||||
26
stacks/data/rsync/stack.yml
Normal file
26
stacks/data/rsync/stack.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
services:
|
||||||
|
rsync:
|
||||||
|
image: alpine:latest
|
||||||
|
user: "0:0"
|
||||||
|
command: >
|
||||||
|
sh -c "
|
||||||
|
apk add --no-cache rsync &&
|
||||||
|
echo '0 2 * * * rsync -av --no-perms --no-owner --no-group --exclude-from=/excludes.txt /source/ /destination/ && echo \"Sync completed at $$(date)\"' | crontab - &&
|
||||||
|
echo 'Backup sync started. Daily sync at 2 AM.' &&
|
||||||
|
crond -f -l 2"
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 30s
|
||||||
|
placement:
|
||||||
|
constraints: [node.role == manager]
|
||||||
|
volumes:
|
||||||
|
- /home/doc/swarm-data/appdata:/source:ro
|
||||||
|
- /home/doc/swarm/appdata:/destination
|
||||||
|
- /home/doc/swarm/swarm-production/conf/rsync-conf/excludes.txt:/excludes.txt:ro
|
||||||
|
networks:
|
||||||
|
- homelab
|
||||||
|
networks:
|
||||||
|
homelab:
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user