0

I made a Powershell script which uses Powercli to create and delete snapshots on my two Esxi hosts, but for some reason the Cronjob isn't working. In the syslog I can see the following message:

(v6.1.0-preview.2:1:80) [Perftrack_ConsoleStartupStop:PowershellConsoleStartup.WinStop.Informational] PowerShell console is ready for user input

If I directly execute the scripts, they work without any issue. Here is the crontab:

\# m h dom mon dow command \* \* \* \* \* /usr/local/bin/vsphere-influxdb-go 0 22 \* \* \* sudo cp -r /dockerdata/ /Storage/01\_Privat/02\_Tech/02\_Home\_Network/03\_Backup/01\_Docker/ 0 22 \* \* \* /usr/local/bin/esx-1-create-new-snapshots.ps1 0 22 \* \* \* /usr/local/bin/esx-1-remove-snapshots-older-than-5-days.ps1 0 22 \* \* \* /usr/local/bin/esx-2-create-new-snapshots.ps1 0 22 \* \* \* /usr/local/bin/esx-2-remove-snapshots-older-than-5-days.ps1 

Any ideas why this isn't working?

2
  • How are you calling powershell in your scripts? Commented Aug 17, 2018 at 13:37
  • #!/usr/bin/pwsh -Command Commented Aug 18, 2018 at 18:59

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.