Added synchronization script and created logs folder
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					/home/archos/git_archlinuxcz/automation-scripts/logs
 | 
				
			||||||
							
								
								
									
										27
									
								
								scripts/sync_gitea_to_github.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								scripts/sync_gitea_to_github.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Nastavení proměnných
 | 
				
			||||||
 | 
					GITEA_REPO="ssh://git@git.arch-linux.cz:29418/Archos/prehlad-financi-komunity.git"
 | 
				
			||||||
 | 
					GITHUB_REPO="git@github.com:zkreml/prehlad-financi-komunity.git"
 | 
				
			||||||
 | 
					TMP_DIR=$(mktemp -d)
 | 
				
			||||||
 | 
					LOG_FILE="/path/to/your/automation-scripts/logs/sync_gitea_to_github.log"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Funkce pro logování
 | 
				
			||||||
 | 
					log() {
 | 
				
			||||||
 | 
					    echo "$(date) - $1" >> $LOG_FILE
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Klonování Gitea repozitáře
 | 
				
			||||||
 | 
					log "Klonování Gitea repozitáře"
 | 
				
			||||||
 | 
					git clone --mirror $GITEA_REPO $TMP_DIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Pushing to GitHub
 | 
				
			||||||
 | 
					log "Pushing to GitHub"
 | 
				
			||||||
 | 
					cd $TMP_DIR
 | 
				
			||||||
 | 
					git push --mirror $GITHUB_REPO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Úklid
 | 
				
			||||||
 | 
					log "Úklid"
 | 
				
			||||||
 | 
					rm -rf $TMP_DIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					log "Synchronizace dokončena"
 | 
				
			||||||
		Reference in New Issue
	
	Block a user