-
- Novice
- Posts: 5
- Liked: 1 time
- Joined: May 17, 2016 9:50 pm
- Full Name: Laura Funk
- Contact:
GitHub Enterprise Maintenance mode Pre and Post Scripts
Has anyone out there tried to backup GitHub Enterprise with Veeam?
I have everything working with the Veeam zip PowerShell commands and windows task scheduler.
Basically you have to connect to the GitHub Server using a ssh certificate over port 122 using the admin@server.domain command, then issue the ghe-maintenance -s to start, and -u to stop.
So I have set up a Linux key credentials with the username of admin@server.domain, passphrase for the ssh certificate and private key. The ssh port is set to 122.
I have placed several variations of .sh, .ps1, and .bat script files all that work from the service account user on the Veeam box, but none work when adding them to the application aware processing scripts, or the advanced job settings scripts.
The command to run on the Veeam server from PowerShell to turn on the maintenance is:
bash -c 'ssh -p 122 admin@server.domain ghe-maintnenace -s'
The commands to run from the Git-Bash utility on the Veeam server are:
ssh -p 122 admin@server.domain
ghe-maintenance -s
How do I tell if the credentials to connect to the GitHub Enterprise server is working, or just bad formatting of the scripts?
Thanks,
Laura
I have everything working with the Veeam zip PowerShell commands and windows task scheduler.
Basically you have to connect to the GitHub Server using a ssh certificate over port 122 using the admin@server.domain command, then issue the ghe-maintenance -s to start, and -u to stop.
So I have set up a Linux key credentials with the username of admin@server.domain, passphrase for the ssh certificate and private key. The ssh port is set to 122.
I have placed several variations of .sh, .ps1, and .bat script files all that work from the service account user on the Veeam box, but none work when adding them to the application aware processing scripts, or the advanced job settings scripts.
The command to run on the Veeam server from PowerShell to turn on the maintenance is:
bash -c 'ssh -p 122 admin@server.domain ghe-maintnenace -s'
The commands to run from the Git-Bash utility on the Veeam server are:
ssh -p 122 admin@server.domain
ghe-maintenance -s
How do I tell if the credentials to connect to the GitHub Enterprise server is working, or just bad formatting of the scripts?
Thanks,
Laura
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: GitHub Enterprise Maintenance mode Pre and Post Scripts
Hi,
Thanks.
There is a difference between pre-job and pre-freeze script - pre-job script is executed on Veeam server, pre-freeze script is executed inside the VM and you need to have VMware tools installed on the VM for that. Which way do you prefer?I have placed several variations of .sh, .ps1, and .bat script files all that work from the service account user on the Veeam box, but none work when adding them to the application aware processing scripts, or the advanced job settings scripts.
Thanks.
-
- Novice
- Posts: 5
- Liked: 1 time
- Joined: May 17, 2016 9:50 pm
- Full Name: Laura Funk
- Contact:
Re: GitHub Enterprise Maintenance mode Pre and Post Scripts
The pre-job script would probably be less complicated than the pre-freeze that is executed inside the VM, because of the certificate authentication.
I have tried the advanced job settings/scripts/Run the following script before the job; is that the pre-job you referenced?
If so I have tried pointing it to the .sh script that works when logged into the Veeam Server, and the PowerShell script that works from the task scheduler on the Veeam server. I even turned off Run administrators in Admin Approval mode, and set the global execution policy.. I have tried setting it up as a .bat as well that also runs if executed as the backup service account on the Veeam server.
The error is that the specified executable is not a valid application for this OS platform. Which makes me think its actually trying to run the script on the GitHub server and not the Veeam Backup server?
I have also tried the pre-freeze script that is located in the Application-Aware Processing Options. Its not apparent what part fails, which makes it more difficult to troubleshoot. Just a generic script terminated with exit code 1
Thanks,
Laura
I have tried the advanced job settings/scripts/Run the following script before the job; is that the pre-job you referenced?
If so I have tried pointing it to the .sh script that works when logged into the Veeam Server, and the PowerShell script that works from the task scheduler on the Veeam server. I even turned off Run administrators in Admin Approval mode, and set the global execution policy.. I have tried setting it up as a .bat as well that also runs if executed as the backup service account on the Veeam server.
The error is that the specified executable is not a valid application for this OS platform. Which makes me think its actually trying to run the script on the GitHub server and not the Veeam Backup server?
I have also tried the pre-freeze script that is located in the Application-Aware Processing Options. Its not apparent what part fails, which makes it more difficult to troubleshoot. Just a generic script terminated with exit code 1
Thanks,
Laura
-
- Novice
- Posts: 5
- Liked: 1 time
- Joined: May 17, 2016 9:50 pm
- Full Name: Laura Funk
- Contact:
Re: GitHub Enterprise Maintenance mode Pre and Post Scripts
I found the Combination that works with GitHub and Veeam
My missing link was that I had to start the Veeam Backup Service with the backup service account that I was logging into the console with.
That backup service account profile has to have the Git-Bash installed, path set, with the ssh keys set up and loaded into the GitHub server.
https://help.github.com/enterprise/2.6/ ... sh-access/
I was not able to get the .sh script to work directly (The specified executable is not a valid application for this OS platform) but you can call the .sh script from a .bat.
This works when calling the .bat from the Advanced Job settings under scripts. -s is for starting (setting) maintenance mode, and -u is for stopping (unsetting) the maintenance mode.
.bat file contents:
StartGitMaint.sh contents:
My missing link was that I had to start the Veeam Backup Service with the backup service account that I was logging into the console with.
That backup service account profile has to have the Git-Bash installed, path set, with the ssh keys set up and loaded into the GitHub server.
https://help.github.com/enterprise/2.6/ ... sh-access/
I was not able to get the .sh script to work directly (The specified executable is not a valid application for this OS platform) but you can call the .sh script from a .bat.
This works when calling the .bat from the Advanced Job settings under scripts. -s is for starting (setting) maintenance mode, and -u is for stopping (unsetting) the maintenance mode.
.bat file contents:
Code: Select all
@echo off
"C:\Program Files\Git\git-bash.exe" d:\scripts\StartGitMaint.sh
Code: Select all
Maint()
{
sleep 5
echo ghe-maintenance -s
}
Maint | ssh -p 122 admin@servername.domainname
echo complete
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: GitHub Enterprise Maintenance mode Pre and Post Scripts
Hi,
Sorry for the late reply. I'm glad that you've nailed it!
Thanks!
Sorry for the late reply. I'm glad that you've nailed it!
So you've tried running the pre-job script as .bat, .ps1, and even .sh and all three throwed you the error ("The specified executable is not a valid application for this OS platform'), whereas all three extensions seem to work when you start them manually on Veeam server, is that correct?The error is that the specified executable is not a valid application for this OS platform. Which makes me think its actually trying to run the script on the GitHub server and not the Veeam Backup server?
Have you checked if there are any EOL characters in your .sh script file?Just a generic script terminated with exit code 1
Thanks!
-
- Novice
- Posts: 5
- Liked: 1 time
- Joined: May 17, 2016 9:50 pm
- Full Name: Laura Funk
- Contact:
Re: GitHub Enterprise Maintenance mode Pre and Post Scripts
Thank you for the Reply PTide!
It is working correctly with the .bat calling the .sh, just not directly calling the .sh. I'm OK with that solution. No end of line characters in the .sh.
Wanted to make sure I posted what worked incase you have other customers with a GitHub Enterprise Server.
Thanks,
Laura
It is working correctly with the .bat calling the .sh, just not directly calling the .sh. I'm OK with that solution. No end of line characters in the .sh.
Wanted to make sure I posted what worked incase you have other customers with a GitHub Enterprise Server.
Thanks,
Laura
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: GitHub Enterprise Maintenance mode Pre and Post Scripts
Just checked with QA team - some extensions (including .sh) have been mistakenly added into the drop-down list that you can see when choosing a pre-job script. Sorry for confusion.It is working correctly with the .bat calling the .sh, just not directly calling the .sh.
Thank you.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Gostev, ssimakov and 172 guests