Migrate services part
This commit is contained in:
		
							parent
							
								
									7c59e4ae57
								
							
						
					
					
						commit
						73bce8f6e5
					
				
					 157 changed files with 3883 additions and 9 deletions
				
			
		
							
								
								
									
										3
									
								
								roles/backup/files/Dockerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								roles/backup/files/Dockerfile
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | |||
| FROM restic/restic | ||||
| 
 | ||||
| RUN apk add curl | ||||
							
								
								
									
										4
									
								
								roles/backup/files/backup.timer
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								roles/backup/files/backup.timer
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| [Timer] | ||||
| OnCalendar=*-*-* 04:10:00 | ||||
| [Install] | ||||
| WantedBy=timers.target | ||||
							
								
								
									
										3
									
								
								roles/backup/files/node001/mailcow.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								roles/backup/files/node001/mailcow.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,3 @@ | |||
| export MAILCOW_BACKUP_LOCATION="$BACKUP_LOCATION/mailcow" | ||||
| mkdir -p "$MAILCOW_BACKUP_LOCATION" | ||||
| /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all | ||||
							
								
								
									
										5
									
								
								roles/backup/files/node002/immich.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										5
									
								
								roles/backup/files/node002/immich.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,5 @@ | |||
| backup_path="$BACKUP_LOCATION/immich" | ||||
| mkdir -p "$backup_path" | ||||
| 
 | ||||
| cd /opt/services/immich || exit | ||||
| docker compose exec database sh -c 'pg_dump -U "$DB_USERNAME" "$DB_DATABASE"' | gzip >"$backup_path/immich.sql.gz" | ||||
							
								
								
									
										14
									
								
								roles/backup/files/node002/postgres.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								roles/backup/files/node002/postgres.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| mkdir -p "$BACKUP_LOCATION/postgres" | ||||
| cd "$BACKUP_LOCATION/postgres" || exit | ||||
| 
 | ||||
| postgres_tables=$(sudo -u postgres psql -Atc "SELECT datname FROM pg_database WHERE datistemplate = false;") | ||||
| 
 | ||||
| for i in $postgres_tables | ||||
| do | ||||
| 	printf "dumping %s ..." "$i" | ||||
| 	sudo -u postgres pg_dump "$i" | gzip >"pg_dump_$i.sql.gz" | ||||
| 	echo " done" | ||||
| done | ||||
| 
 | ||||
| echo "dumping all" | ||||
| sudo -u postgres pg_dumpall | gzip >"pg_dumpall.sql.gz" | ||||
							
								
								
									
										3
									
								
								roles/backup/files/node003/mailcow.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								roles/backup/files/node003/mailcow.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,3 @@ | |||
| export MAILCOW_BACKUP_LOCATION="$BACKUP_LOCATION/mailcow" | ||||
| mkdir -p "$MAILCOW_BACKUP_LOCATION" | ||||
| /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue