add restic config
This commit is contained in:
		
							parent
							
								
									0715bdafd4
								
							
						
					
					
						commit
						9420f6875e
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
.autorestic.env
 | 
			
		||||
.autorestic.lock.yml
 | 
			
		||||
							
								
								
									
										81
									
								
								backups/.autorestic.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								backups/.autorestic.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,81 @@
 | 
			
		||||
version: 2
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
global:
 | 
			
		||||
  forget:
 | 
			
		||||
    keep-hourly: 24
 | 
			
		||||
    keep-daily: 7
 | 
			
		||||
    keep-weekly: 4
 | 
			
		||||
    keep-monthly: 12
 | 
			
		||||
 | 
			
		||||
backends:
 | 
			
		||||
  fch:
 | 
			
		||||
    type: sftp
 | 
			
		||||
    path: FCH_serveur:backups/
 | 
			
		||||
 | 
			
		||||
locations:
 | 
			
		||||
  nextcloud_data:
 | 
			
		||||
    from:
 | 
			
		||||
    - /var/lib/docker/volumes/docker_nextcloud
 | 
			
		||||
    to:
 | 
			
		||||
    - fch
 | 
			
		||||
    cron: 0 0 * * *
 | 
			
		||||
    forget: prune
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  nextcloud_conf:
 | 
			
		||||
    from:
 | 
			
		||||
    - /var/lib/docker/volumes/docker_nextcloud-conf
 | 
			
		||||
    to:
 | 
			
		||||
    - fch
 | 
			
		||||
    cron: 0 0 * * *
 | 
			
		||||
    forget: prune
 | 
			
		||||
 | 
			
		||||
  nextcloud_data:
 | 
			
		||||
    from:
 | 
			
		||||
    - /var/lib/docker/volumes/docker_nextcloud
 | 
			
		||||
    to:
 | 
			
		||||
    - fch
 | 
			
		||||
    cron: 0 0 * * *
 | 
			
		||||
    forget: prune
 | 
			
		||||
 | 
			
		||||
  nextcloud_db:
 | 
			
		||||
    from:
 | 
			
		||||
    - /DATA/dump_bdd/nextcloud-db
 | 
			
		||||
    to:
 | 
			
		||||
    - fch
 | 
			
		||||
    cron: 0 0 * * *
 | 
			
		||||
    forget: prune
 | 
			
		||||
    hooks:
 | 
			
		||||
      before:
 | 
			
		||||
      - /DATA/docker/services/backups/backup_db.sh nextcloud-db  postgresql
 | 
			
		||||
 | 
			
		||||
  onlyoffice:
 | 
			
		||||
    from:
 | 
			
		||||
    - /var/lib/docker/volumes/docker_onlyoffice-cache
 | 
			
		||||
    - /var/lib/docker/volumes/docker_onlyoffice-data
 | 
			
		||||
    to:
 | 
			
		||||
    - fch
 | 
			
		||||
    cron: 0 0 * * *
 | 
			
		||||
    forget: prune
 | 
			
		||||
 | 
			
		||||
  traefik-certs:
 | 
			
		||||
     from:
 | 
			
		||||
     - /DATA/docker/services/certs
 | 
			
		||||
     to:
 | 
			
		||||
     - fch
 | 
			
		||||
     cron: 0 0 * * *
 | 
			
		||||
     forget: prune
 | 
			
		||||
 | 
			
		||||
  repos:
 | 
			
		||||
     from:
 | 
			
		||||
     - /DATA/docker/services/
 | 
			
		||||
     to:
 | 
			
		||||
     - fch
 | 
			
		||||
     options:
 | 
			
		||||
       backup:
 | 
			
		||||
         exclude:
 | 
			
		||||
         - '.git'
 | 
			
		||||
     cron: 0 0 * * *
 | 
			
		||||
     forget: prune
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								backups/autorestic.service
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								backups/autorestic.service
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,10 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Backups yay
 | 
			
		||||
 
 | 
			
		||||
[Service]
 | 
			
		||||
Type=oneshot
 | 
			
		||||
ExecStart=autorestic -c /DATA/docker/services/backups/.autorestic.yml --ci cron
 | 
			
		||||
# fail if backup takes more than 1 day
 | 
			
		||||
TimeoutStartSec=86400
 | 
			
		||||
IPAccounting=yes
 | 
			
		||||
MemoryAccounting=yes
 | 
			
		||||
							
								
								
									
										9
									
								
								backups/autorestic.timer
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								backups/autorestic.timer
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Backups yay
 | 
			
		||||
 
 | 
			
		||||
[Timer]
 | 
			
		||||
# Trigger every 10 minutes
 | 
			
		||||
OnCalendar=*:0/10:0
 | 
			
		||||
 
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=timers.target
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
# 
 | 
			
		||||
# exports the database of a running docker container in a dump in $BACKUP_DIR/$CONTAINER_NAME/
 | 
			
		||||
 | 
			
		||||
BACKUP_DIR=/DATA/BACKUP/dbdumps
 | 
			
		||||
BACKUP_DIR=/DATA/dump_bdd/
 | 
			
		||||
 | 
			
		||||
# Check container existence
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user