Compare commits
	
		
			2 commits
		
	
	
		
			
				65dda1f790
			
			...
			
				c9bb1f1029
			
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| c9bb1f1029 | |||
| 547ee07a6b | 
					 6 changed files with 19 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -27,7 +27,8 @@ sudo -u cloud unzip -d /data/cloud ~/latest.zip
 | 
			
		|||
DOMAIN=example.com
 | 
			
		||||
 | 
			
		||||
sudo cp nginx.conf /etc/nginx/sites-available/nextcloud
 | 
			
		||||
sudo cp fpm.conf /etc/php/*/fpm/pool.d/nextcloud.conf
 | 
			
		||||
sudo cp fpm.conf /etc/php/nextcloud.conf
 | 
			
		||||
sudo ln -s /etc/php/nextcloud.conf /etc/php/*/fpm/pool.d
 | 
			
		||||
sudo sed -i '$ r redis.conf' /etc/redis/redis.conf
 | 
			
		||||
 | 
			
		||||
sudo -u cloud cp local.config.php /data/cloud/nextcloud/config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,12 +9,20 @@ REPO=sftp:backup-user@example.com:repo
 | 
			
		|||
bunzip2 restic*.bz2
 | 
			
		||||
sudo cp restic* /usr/local/bin/restic
 | 
			
		||||
 | 
			
		||||
echo 'nice /usr/local/bin/restic -r' "$REPO" '-p /root/backup-key "$@"' | sudo tee /root/restic-cmd
 | 
			
		||||
sudo chmod +x /root/restic-cmd
 | 
			
		||||
sudo cp restic-* /usr/local/bin
 | 
			
		||||
sudo sed -i s/REPO/$REPO/ /usr/local/bin/restic-repo
 | 
			
		||||
 | 
			
		||||
cat /dev/urandom | base64 | head -c 64 | sudo tee /root/backup-key
 | 
			
		||||
sudo chmod 600 /root/backup-key
 | 
			
		||||
cat /dev/urandom | head -c 48 | base64 | sudo tee /etc/restic-key
 | 
			
		||||
sudo chmod 600 /etc/restic-key
 | 
			
		||||
 | 
			
		||||
sudo /root/restic-cmd init
 | 
			
		||||
sudo crontab crontab
 | 
			
		||||
sudo restic-repo init
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## `sudo crontab -e`
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
PATH=/usr/local/bin:/usr/bin:/bin
 | 
			
		||||
 | 
			
		||||
48 *	* * *	restic-backup
 | 
			
		||||
18 2	* * *	restic-forget
 | 
			
		||||
```
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,2 +0,0 @@
 | 
			
		|||
48 *	* * *	/root/restic-cmd backup -q --exclude-if-present .nobackup /data
 | 
			
		||||
18 3	* * *	/root/restic-cmd forget -q --keep-tag keep -H 24 -d 7 -m 12 -y 100
 | 
			
		||||
							
								
								
									
										1
									
								
								restic/restic-backup
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										1
									
								
								restic/restic-backup
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
restic-repo backup -q --exclude-if-present .nobackup /data
 | 
			
		||||
							
								
								
									
										1
									
								
								restic/restic-forget
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										1
									
								
								restic/restic-forget
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
restic-repo forget -q --keep-tag keep -H 48 -d 7 -m 12 -y 100
 | 
			
		||||
							
								
								
									
										1
									
								
								restic/restic-repo
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										1
									
								
								restic/restic-repo
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
nice restic -r REPO -p /etc/restic-key "$@"
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue