Comprehensive data protection for all workloads
Post Reply
it.smzo
Lurker
Posts: 2
Liked: never
Joined: Sep 03, 2018 2:05 pm
Full Name: IT SMZO
Contact:

Issue with post script / putty

Post by it.smzo »

Hi

In our company we want to create a backup job, which turns a Synology NAS (DS1010+) on before the job and off after the job.

So we wrote a batch wich turns on the NAS before the job using wol.exe:

Code: Select all

"C:\Offline-Backup\wol.exe" MAC-ADDRESS
ping -n 301 127.0.0.1 > NUL
exit
Added to the pre-job script it works and the NAS powers on.

So we wrote a batch to turn off the NAS using plink.exe from PuTTY:

Code: Select all

cd "C:\Offline-Backup\PuTTY\"
plink.exe -ssh -pw MY-PASSWORD root@IP-ADDRESS shutdown -P 1
exit
If we start the batch manually, the NAS turns off after 1 minute and the cmd-windows closes.
But if we start the batch as post-job script, the NAS doesn't turn off. The post-job script keeps runnung for 15 minutes and then times out. In the windows task manager it seems that the cmd window is still running and won't close automaticly.

What could cause the problem? Any suggestions?

Thanks
Vitaliy S.
VP, Product Management
Posts: 27114
Liked: 2720 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Issue with post script / putty

Post by Vitaliy S. »

Hello,

Based on the symptoms I would say this might be a security problem, since your 2nd script executes just fine when triggered manually under logged in account. Have you tried checking if Veeam service has enough permissions to execute your second script?

Thanks!
it.smzo
Lurker
Posts: 2
Liked: never
Joined: Sep 03, 2018 2:05 pm
Full Name: IT SMZO
Contact:

Re: Issue with post script / putty

Post by it.smzo »

Hi,

Thanks for your answer! I figured out what the problem was.

Plink.exe from PuTTY ask the first time you connect with a server if you want to store the ecdsa-sha2-nistp256 key in cache. Plink.exe asks this for each user.
So I had to run the script manually with the SYSTEM account and answer the question to store the key with "YES".

Thanks!
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Issue with post script / putty

Post by tdewin »

Well it could be that the hosts is indeed not accepted (because it is a new ip). I made a wrapper script in the past that sends the yes. Take a look
https://github.com/VeeamHub/powershell/ ... nk-Wrapper

Basically with powershell you can just send "yes" to the input of plink:
$p.StandardInput.Write("yes")
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 99 guests