Added backup and deploy scripts
This commit is contained in:
		
							parent
							
								
									fb955625bc
								
							
						
					
					
						commit
						563b9023dc
					
				
							
								
								
									
										17
									
								
								data_backup.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								data_backup.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Get the current timestamp in the format DD-MM-YY-TIME
 | 
				
			||||||
 | 
					timestamp=$(date +"%d-%m-%y-%H%M%S")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Define the source file and the destination directory and file
 | 
				
			||||||
 | 
					src="data.db"
 | 
				
			||||||
 | 
					dst_dir="backups"
 | 
				
			||||||
 | 
					dst_file="data-${timestamp}.db"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Make backups dir if necessary
 | 
				
			||||||
 | 
					mkdir -p $dst_dir
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Move and rename the file
 | 
				
			||||||
 | 
					mv "${src}" "${dst_dir}/${dst_file}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "File has been moved to ${dst_dir} and renamed to ${dst_file}"
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user