Last active
August 20, 2018 19:36
-
-
Save peisenhower/c9c6c46b5ab6e82793e3ef6859be338a to your computer and use it in GitHub Desktop.
Script to backup nexus server, programatically re-index and offload backup to s3 bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO ON | |
SET OUT_PATH=C:\nexus-backup\nexus_backup_%date:~4,2%%date:~7,2%%date:~10,4%.zip | |
SET NEXUS_BACKUP="C:\Program Files (x86)\Altium\Altium NEXUS Server\Tools\BackupTool\avbackup.exe" | |
@rem Backing up nexus server | |
%NEXUS_BACKUP% backup -z %OUT_PATH% | |
@rem Backup Complete | |
SLEEP 300 | |
@rem Forcing Re-Index | |
Get-ChildItem IIS:\AppPools | where {$_.state -eq "Started"} | Stop-WebAppPool | |
SLEEP 10 | |
rm C:\ProgramData\Altium\NexusServerData\SearchData\* | |
Get-ChildItem IIS:\AppPools | where {$_.state -eq "Stopped"} | Start-WebAppPool | |
@rem Re-Index Starting | |
set AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxx | |
set AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxx | |
set AWS_DEFAULT_REGION=us-east-1 | |
@rem offload backup | |
aws s3 cp %OUT_PATH% s3://altium-nexus-backup/nexus_backup_%date:~4,2%%date:~7,2%%date:~10,4%.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment