Powershell script run with TaskScheduler not stopping VM's

I have a script that stops and starts the VM's, and copies files and it works ok when I run it with powershell, but when I run it with TaskScheduler, it's not stopping/starting the VM's (but does copy files).  We have server 2008 R2.  I updated
powershell to version 3 and downloaded and installed the Hypver-V powershell module from Microsoft.
Also, when I run the script through powershell, I needed to run as administrator.  When I run it with the powershell prompt this is what it looks like:
C:\windows\system32> powershell -NoProfile -noninteractive -ExecutionPolicy bypass -Command "& c:\Scripts\BackupVhdShell_2_param.ps1 -single_backup_file_to_loc 'E:\' -single_backup_file_from_loc 'S:\SQL-bak.vhd'"
So that works from powreshell to start/stop vm's and copy files.
In Task Scheduler, this is how I have it set up:
Run with highest priviledges is checked. I have my login credentials saved so it can wake up the server when I'm not here or if it's not up.  
In The Program/script field: %SystemRoot%\SysWow64\WindowsPowerShell\v1.0\powershell.exe
In the Add Arguments field: -NoProfile -noninteractive -ExecutionPolicy bypass -Command "& c:\Scripts\BackupVhdShell_2_param.ps1 -single_backup_file_to_loc 'E:\' -single_backup_file_from_loc 'S:\SQL-bak.vhd'"
Any thoughts?  I'm not sure if TaskManager isn't finding HyperV module?
This is what the majority of the script looks like:
param($single_backup_file_to_loc, $single_backup_file_from_loc)
function StopVMsInOrder ([array][String]$vmNames){ 
#this function will stop VM's in list, sequentially 
   Write-Host "Processing virtual machines in order"
   foreach ($name in $vmNames) {
       Write-Host "Analyzing $name"
       Try {
             #Write-Host "...Saving $name"
             #Save-VM -VM $name -wait -Force
             Write-Host "..shutdown $name" #name)"
             Invoke-VMShutdown -VM $name -Force #$vm.name
       } #try
       Catch {
          Write-Host "Failed to get virtual machine $name"
       } #catch
   }#foreach
} #function StopVMsInOrder
function StartVMsInOrder ([array][String]$vmNames){ 
#this function will start VM's in list, sequentially as opposed to all at once
   Write-Host "Processing virtual machines in order"
   foreach ($name in $vmNames) {
       Write-Host "Analyzing $name"
       Try {
             Write-Host "..Starting $name"
             Start-VM -VM $name -wait
       } #try
       Catch {
          Write-Host "Failed to get virtual machine $name"
       } #catch
   }#foreach
} #function StartVMsInOrder
function CopyFileToFolder ([string]$Source,[string]$destination){  
   # get filename  
#################start of script##############
import-module Hyperv
#get list of running vm's
[array]$vmNames = @(Get-VM -Running | %{$_.elementname})  
Write-Host "To: $single_backup_file_to_loc"
Write-Host "From: $single_backup_file_from_loc"
#call function to stop vm's
StopVMsInOrder $vmNames      
if($single_backup_file_to_loc -ne " ")
   #someone passed in a parameter for one-off use of script
   [array]$destFileArray = @($single_backup_file_to_loc)
   [array]$sourceFileArray = @($single_backup_file_from_loc)
}else
   Write-Host "To Loc not Defined as param"
   #get set up for what need to backup vhd's
   #where back it up to
$i=0
for ($i = $sourceFileArray.GetLowerBound(0); $i -le $sourceFileArray.GetUpperBound(0); $i++) { 
        $tempSource =  $sourceFileArray[$i]
        $tempDest = $destFileArray[$i]
        CopyFileToFolder $tempSource $tempDest
        Write-Host "i: $i"
Write-Host "Done with vhd backup"
#call function to start vm's
StartVMsInOrder $vmNames  
Write-Host "Done with vm start"
Michele Cleary

I finally figured it out!  I changed it so I was using the 32 bit version of powershell in TaskScheduler:  %SystemRoot%\system32\....  Now it's finding the VM's!
Michele Cleary
Just FYI - system32 is x64. SysWOW64 is x86.
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)

Similar Messages

  • Azure powershell script runs locally bu not in webjob

    I downloaded Azure commandlets locally and changed the Azure website size by just running an Azure powershell script i wrote. However, uploading it to run as a webjob on my Azure website it fails with the same errors it did locally Before installing Azure
    Powersehll. Looking in kudu I see windows powershell but no azure powershell. Do I need to install Azure powershell to my website somehow?

    Done! >And it already got some attention :)
    http://feedback.azure.com/forums/169385-websites/suggestions/7155775-add-azure-commandlets

  • Right click on script"run with PowerShell"

    I have set the execution policy in GPO to remoteSigned, and it is working fine, when I run the script from cmd prompt powershell –f
    When I right click the script and choose “run with PowerShell” it starts with this text in red
    Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. 
    Due to the override, your shell will retain its current effective executionpolicy of RemoteSigned
    The script is working, but it do not look right for a user of the script.
    Sometimes when I run the script “run with PowerShell” it prompts the user to overwrite policy, again no matter if I choose yes or no, the script will run.
    I am running on Windows 8.1 Update 1 x64, Powershell 4.0
    Do anyone know how to fix?
    Kind Regards
    Jens
    Jens Lund

    There is another Group Policy setting that is setting a different policy. Post in the GP forum to get help with fixing this.
    Possibility #2.  You are setting the policy in your profile or on the command line.
    ¯\_(ツ)_/¯

  • I have my Calendar app syncing with iCloud.  Every time I open it it says, "Moving Calendars to Server Account..."  It runs and runs and does not stop.  As a result, I cannot access my calendars.  Please help.

    I have my Calendar app syncing with iCloud.  Every time I open it it says, "Moving Calendars to Server Account..."  It runs and runs and does not stop.  As a result, I cannot access my calendars.  Please help.

    I have the same problem, I tried the solution of Dr Cox but that didn't work as he said go to system preference then mail, contacts etc. but I don't have that.  Can someone help?
    Elaine

  • The PowerShell script failed with below exception

    I'm receiving the following errors on all SQL Express Servers (every machine that has SQL Express inside).
    it seems that the discovery has found SQL Express but could not connect to the instance.
    details on the alerts:
    Date and Time:
    10/22/2013 12:04:22 PM
    Log Name:
    Operations Manager
    Source:
    Health Service Modules
    Generating Rule:
    Collect Power Shell Module Events
    Event Number:
    22406
    Level:
     Error
    Logging Computer:
    SQLEXPRESS.DOMAIN.COM
    User:
    N/A
    Description:
    The PowerShell script failed with below exception
    System.Management.Automation.RuntimeException: Exception calling "Fill" with "1" argument(s): "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not
    accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
    At line:44 char:19
    + $SqlAdapter.Fill <<<< ($DataSet)|out-null
    at System.Management.Automation.FlowControlNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
    at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
    at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
    Script Name: StolenServerMemory2008.ps1
    One or more workflows were affected by this.
    Workflow name: Microsoft.SQLServer.2008.DBEngine.StolenServerMemoryMonitor
    Instance name: SQLEXPRESS
    Instance ID: {9705795C-4F3B-C2EF-AA7D-C736B40FD6A4}
    Management group: SCOMGROUP 

    Some additional inf.
    http://stackoverflow.com/questions/6466974/unable-to-connect-to-sql-express-error-26-error-locating-server-instance-speci?rq=1
    anyway you can disable this rule/monitor as no control from monitoring solution in that case. Or try to rewrite the same monitor...
    The problem in your case is when function tries to get Max Server Memory MB by connecting to master DB, but you can replace it with performance counter like Target Server Memory (KB)...
    just see the function main in StolenServerMemory2008.ps1 and what you need to replace
    $api = New-Object -comObject "MOM.ScriptAPI"
    $bag = $api.CreatePropertyBag()
    $msg = [Environment]::NewLine
    $err = [Environment]::NewLine
    #try {
    $maxMemoryMB = GetMaxServerMemoryMB $ComputerName $InstanceName
    $stolenPages = (Get-Counter ("\" + $PerformanceCounterObject + ":Buffer Manager\Stolen Pages")).CounterSamples[0].CookedValue
    $pakeSizeKB = 8
    [double]$stolenMemoryMB = $stolenPages * $pakeSizeKB / 1024                                      
    [double]$stolenMemoryPercent = 0
    if($maxMemoryMB -gt 0){
    [double]$stolenMemoryPercent= 100.0 * $stolenMemoryMB / $maxMemoryMB
    $bag.AddValue("StolenMemoryMB", $stolenMemoryMB)
    $bag.AddValue("StolenMemoryPercent", $stolenMemoryPercent)                                  
    $msg += "StolenMemoryMB=$stolenMemoryMB StolenMemoryPercent=$stolenMemoryPercent"
    $msg += [Environment]::NewLine                          
    #debug $api.LogScriptEvent("SQL 2008 Stolen Server Memory data source", $SCRIPT_EVENT_ID, $INFORMATION_EVENT_TYPE, $msg + $err)                     
    #catch {
    #             $header = "Managegement Group: $Target/ManagementGroup/Name$. Script: {0}" -f ($MyInvocation.MyCommand).Name.ToString()
    #             $msg += "Error occured during SQL 2008 Stolen Server Memory data source executing.{0}Computer:{1} {0}Reason: {2}" -f [Environment]::NewLine, $env:COMPUTERNAME, $_.Exception.Message
    #             $api.LogScriptEvent($header, $SCRIPT_EVENT_ID, $ERROR_EVENT_TYPE, $msg + $err)                           
    $bag

  • I created a script to add logos to photos at a club and now when I run the script, the script runs but does not actually place anything on the photo itself.  What's going on?

    I created a script to add logos to photos at a club and now when I run the script, the script runs but does not actually place anything on the photo itself.  What's going on?

    He meant post it here, of course, Louie!  How on Earth would you post it "on Photoshop" ? 
    Thank you for the belly laugh. 

  • Powershell script monitor with encrypted password

    I have created a powershell script based monitor in my management pack and everything is ok but I can't get my credentials work inside the script. I want to open pssession to another computer with my credentials. I have triple checked that my pssession is
    working because I can access it from powershell console.
    This works perfectly at local server from PSconsole:
    $EncryptedPassword ="01000000d08c9ddf0115d1118c7a00c04fc297eb01000000534b2....etc...etc..."
    $pw = convertto-securestring -String $EncryptedPassword
    $cred = new-object System.Management.Automation.PSCredential -argumentlist "MyDOMAIN\MyACCOUNT",$pw
    $s = New-PSSession -ComputerName "MyServer" -Port MyPort -Credential $cred
    But when I run the same lines inside my management pack the convertto-securestring
    does nothing, it just wont convert the encrypted password to secure string!
    I have tried this plain text method and it works
    inside my management pack, but I don't want to use it because you can see the password in plain text:
    ConvertTo-SecureString -String "myPlainTextPassword" -AsPlainText -Force
    This is the $error variable, so it's basically says that I don't have anything in the password secure string variable because the convertion did not work for some reason:
    The argument is null. Provide a valid value for the argument, and then try running the command again. Cannot process argument transformation on parameter 'Credential'. PromptForCredential Exception calling ".ctor" with "2" argument(s):
    "Cannot process argument because the value of argument "password" is null. Change the value of argument "password" to a non-null value." The system cannot find the file specified. Exception calling "SecureStringToBSTR"
    with "1" argument(s): "Value cannot be null. Parameter name: s" The system cannot find the file specified. Exception calling "SecureStringToBSTR" with "1" argument(s): "Value cannot be null. Parameter name: s"
    The system cannot find the file specified. 
    So is there some known issue with SCOM Agent / management pack when you are dealing with convertto-securestring
    function with encrypted passwords?
    I used these methods to encrypt the password: Technet article about encryption

    I got it to work!
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="MyClass" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.LocalApplication" Hosted="true" Singleton="false" Extension="false"
    />
          </ClassTypes>
        </EntityTypes>
        <SecureReferences>
          <SecureReference ID="MyRunAsAccountProfile" Accessibility="Public" Context="System!System.Entity" />
        </SecureReferences>
    <ScriptBody>param (
      [string]$Username,
      [string]$Password
    $API = new-object -comObject "MOM.ScriptAPI" 
    $PropertyBag = $API.CreatePropertyBag()
    $cred = New-Object System.Management.Automation.PSCredential -Argumentlist @($Username,(ConvertTo-SecureString -String $Password -AsPlainText -Force))
    $s = New-PSSession -ComputerName "myserver" -Credential $cred
    Invoke-Command -Session $s -ScriptBlock { $service = Get-Service -Name Spooler}
    $invcom = Invoke-Command -Session $s -ScriptBlock { $service.status}
    Remove-PSSession -Id $s.Id
    if ($invcom.Value -ne "Running") {
    $PropertyBag.AddValue("State","ERROR") 
    $outputLongLine = "Spooler Service is not running on target server!" 
    $PropertyBag.AddValue("Description", $outputLongLine)
    else {
    $PropertyBag.AddValue("State","OK") 
    $outputLongLine = "Spooler is Running on target server."
    $PropertyBag.AddValue("Description", $outputLongLine) 
    $PropertyBag</ScriptBody>
    <Parameters>
    <Parameter>
    <Name>Username</Name>
     <Value>$RunAs[Name="MyRunAsAccountProfile"]/Domain$\$RunAs[Name="MyRunAsAccountProfile"]/UserName$</Value>
    </Parameter>
    <Parameter>
    <Name>Password</Name>
    <Value>$RunAs[Name="MyRunAsAccountProfile"]/Password$</Value>
    </Parameter>

  • Multi-Select Script Runs in ISE, not on remote Hyper-V Server

    Hello All!
    I've created  a powershell script to allow a user to launch one of several management tools on a Hyper-V server. The script runs fine in Powershell ISE on my system (none of the tools work, obviously) but when I run it on the remote server, these errors
    come up:
    At C:\Mgmt\MgmtSel.ps1:70 char:1
    + }
    + ~
    Unexpected token '}' in expression or statement.
    At C:\Mgmt\MgmtSel.ps1:72 char:1
    + }
    + ~
    Unexpected token '}' in expression or statement.
    At C:\Mgmt\MgmtSel.ps1:73 char:1
    + }
    + ~
    Unexpected token '}' in expression or statement.
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken
    When I paste it directly into the Powershell window, it runs fine. So strange! I know my brackets are correct, or it wouldn't run when pasted into the shell or in ISE. Anyway, any help you could provide would be appreciated. Thank you all for your time!
    Here's the script:
    <######################################################################
    Present user with options to launch one of several management programs
    Save as MgmtSel.ps1 in c:\Mgmt
    v 0.1 Basic Menu Presentation for different management tools
    Written By Ricky Carleton
    Based on code by Paul Westlake
    ######################################################################>
    $xAppName = ‘MgmtSel’
    [BOOLEAN]$global:xExitSession=$false
    function LoadMenuSystem(){
    [INT]$xMenu1=0
    [INT]$xMenu2=0
    [BOOLEAN]$xValidSelection=$false
    while ( $xMenu1 -lt 1 -or $xMenu1 -gt 4 ){
    CLS
    #… Present the Menu Options
    Write-Host “`n`tLogin Management Tools Selection – Version 0.1`n” -ForegroundColor Magenta
    Write-Host “`t`tPlease select the admin area you require`n” -Fore Cyan
    Write-Host “`t`t`t1. sconfig console” -Fore Cyan
    Write-Host “`t`t`t2. Corefig” -Fore Cyan
    Write-Host “`t`t`t3. Hyper-V Mgmt” -Fore Cyan
    Write-Host “`t`t`t4. Quit and exit`n” -Fore Cyan
    #… Retrieve the response from the user
    [int]$xMenu1 = Read-Host “`t`tEnter Menu Option Number”
    if( $xMenu1 -lt 1 -or $xMenu1 -gt 4 ){
    Write-Host “`tPlease select one of the options available.`n” -Fore Red;start-Sleep -Seconds 1
    Switch ($xMenu1){ #… User has selected a valid entry.. load next menu
    1 {
    CLS
    Write-Host “`t`tStarting sconfig`n” -Fore Cyan
    start c:\Windows\System32\sconfig.cmd
    2 {
    CLS
    Write-Host “`t`tStarting Corefig`n” -Fore Cyan
    C:\Corefig\COREFIG.PS1
    3 {
    while ( $xMenu2 -lt 1 -or $xMenu2 -gt 3 ){
    CLS
    # Present the Menu Options
    Write-Host “`n`tSelect the Hyper-V Mgmt Tool you would like to use`n” -Fore Cyan
    Write-Host “`t`t`t1. PSHVM30” -Fore Green
    Write-Host “`t`t`t2. ProHVM (not working yet)” -Fore Green
    Write-Host “`t`t`t3. Go to Main Menu`n” -Fore Green
    [int]$xMenu2 = Read-Host “`t`tEnter Menu Option Number”
    if( $xMenu1 -lt 1 -or $xMenu1 -gt 3 ){
    Write-Host “`tPlease select one of the options available.`n” -Fore Red;start-Sleep -Seconds 1
    Switch ($xMenu2){
    1 {
    CLS
    Write-Host “`t`tStarting PSHVM`n” -Fore Cyan
    call powershell -WindowStyle Hidden C:\PSHVM30\hyperv.ps1
    2 {
    CLS
    Write-Host “`t`tStarting Corefig (For now, later, ProHVM)`n” -Fore Cyan
    start C:\Corefig\COREFIG.PS1
    default { Write-Host “`n`tYou Selected Option 3 – Go to Main Menu`n” -Fore Yellow; break}
    default { $global:xExitSession=$true;break }
    LoadMenuSystem
    If ($xExitSession){
    Exit-PSSession #… User quit & Exit
    } Else {
    C:\Mgmt\MgmtSel.ps1 #… Loop the function

    How are you running the script on the server? Pasting into the ISE on the server, saving as a script and running it from the command line on the server? Or something else?
    When you say you paste it into the PowerShell window and it runs fine, is this PowerShell window on your machine or the server? How are you pasting it (RDP? Teamviewer? VNC?).
    It appears that some of the characters are not being saved/pasted correctly. You could try paste into notepad first and make sure all the characters are correct there, then select all and paste into the window on the server, or use noteapad to save the document
    as a regular text file before copying to the server.

  • Using Powershell Script Run simple query in MS Access 2007 and export the results of query to Excel

    Hi Experts,
    I have a Access 2007 DB file and 2 Big tables inside that (bigger than the size that can be easily handled by MS Excel 2007).
    My requirement is automate using powershell scripts the below things.
    1. Create a SQL query in Access DB and save that in access DB
    2. Run the saved query and export the result in excel sheet where I can create the charts and Pivots. Thanks in advance
    Prajesh

    Do you have to use the Access query, couldn't you just recreate the query in Powershell?  Here's a link with good info that references an existing script for querying an Access database:
    http://blogs.technet.com/b/heyscriptingguy/archive/2009/08/13/hey-scripting-guy-can-i-query-a-microsoft-access-database-with-a-windows-powershell-script.aspx
    Once you have your dataset you can pipe it to
    Export-Csv -NoType c:\pathtofile\output.csv

  • Firefox freezes due to a script running. how can I stop it or fix it

    I keep having a script run when I am playing Face Book games Especially Battle Pirates and it freezes everything. What can i do to stop it? Or fix it so it dosen't freeze my game?
    This script runs over and over while I am playing Battle Pirates. Every time it runs it freezes the darn game and I have to click and click on the screen before a box pops up with a long string and asks if I want to stop the string. This is what it says:
    "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete."
    " Script:http://static.ak.fbcdn.net/rsrc.php/...tS5XVSwP/ks:42 "
    What is this and dose it need to run or is it a hacker messing with me and my FF browser ?
    When I'm in the middle of a battle screen and it freezes it messes me up. If I am in full screen when it freezes it throws me to another open Browser tab or out of full screen if i don't have another open.
    What is this? Something to do with FaceBook? A Hacker ? A BP game glitch. please help. This is driving me crazy. Imagine being in the middle of the best part of a BP battle and freeze.... then click click click i go and zoom to another open window away from the battle so i no longer have a view of the fight let alone control it or boom to non full screen and 1/2 the screen is obscured.
    It just happened again while I was typing this request for help. I have a window open with BP also and it took me there. HELP

    Hi knighterrant56,
    Have you looked at the Knowledge Base article [[Problems using Facebook in Firefox]]? There is a lot of good troubleshooting information in there. Please be sure to try all of the suggested steps. Each one is valuable and may be the answer to your issue.
    Hopefully this helps!

  • PowerShell Script running Excel won't run on Windows Server 2008 R2

    I have a script that creates a report of a single example of each warning or error in the Windows Event log, for each server in a list of servers,with the number of times that error has occurred in the last week on each server. It creates this report in
    Excel. I have this script running automated through Task Scheduler for one client on Windows 7 and it's working perfectly. I have another client that I am attempting to run this script automated on a server running Windows Server 2008 R2. I can manually run
    the script and everything works, but if I try to schedule the script everything works except for the Excel PowerShell commands. I've have tried:
    Created the Desktop folders for config\systemprofile in System32 and in SysWOW64.
    Configured permissions in DCOM for Microsoft Excel Application.
    Configured folder permissions for config\systemprofile.
    Verified PowerShell is working.
    Unchecked the option in the task to only run while logged on.
    Does anyone have any idea why this is happening and how I can fix it? Thanks!
    Sincerely,
    Christopher Beard

    You might have to launch the application once as the system account so that it can set up the Excel environment, I've had the same problem when  trying to update Excel files from an admin Powershell console using my admin account.  Use psexec with
    a -s option to run it as system account locally while logged on to the target server:
    psexec -s "c:\program files (x86)\microsoft office\office14\excel.exe"
    Then you'll most likely be prompted to input initials - which is what I suspect is preventing your code from running properly.
    There may be some other more elegant way to handle this, but you'd be better off asking that question in one of the forums devoted to Office products.
    I hope this post has helped!

  • Script errors with Weatherbug, not related to "unresponsive" problem

    This script problem with Weatherbug has been going on forever. It is not the "unresponsive" script error problem. I get repeated messages asking me if I want to continue running scripts. ( followed buy the error message {invalid etc}) Responding "yes" or "no" results in nothing, just another script error message I changed the "dom.max_script_run_time" to "0" as recommended from a WWW support site, this had no effect.

    http://www.msi.com.tw/program/support/cpu_support/cpu/spt_cpu_detail.php?UID=22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&NAME=MS-6378
    what pcb revision
    will be with name between pci slots

  • How do I reeve the TomTom application from my MacPro Notebook. Application continues to run and will not stop. I bought a Tom Tom GPS and installed the connect app but decided to return the GPS. There seems to be no way to remove the software.

    How do I remove the TomTom GPS software from my MacPro. I bought the GPS and began to install the software but decided to return the GPS. The software will not delete and continues to run trying to connect to the GO 60. I have 10.9.5 OS.
    Tanks to anyone who may help.

    Hi ..
    Follow the instructions here >  How To Completely Uninstall Software under Mac OS X

  • Bash script run via cron not executing MYSQL command

    I have a bash script which is run from a cron,
    It is executing as I have it write to a log file which it does correctly.
    I am wanting the bash script to restore a mysqldump file.
    When I run the bash script manually the dump file gets loaded fine. But when I run it through the cron the mysql command appears to be ignored.
    The mysqldump file is 54MB and I have checked to make sure that MYSQL is included in the global users path in /etc/profile
    Does anyone know why this maybe??
    Here is the bash file
    #!/bin/bash
    date >> /home/user/crons/crons.log
    echo "Started loadbackup" >> /home/user/crons/crons.log
    cd /home/user
    dbuser=root
    dbpass=password
    dbname=databasename
    filename=backup
    mysql -hlocalhost -u"$dbuser" -p"$dbpass" "$dbname" < " >> /home/user/crons/crons.log
    My crontab looks like
    02 17 * * * /home/user/crons/loadbackup.sh
    Many thanks
    Richard

    Hi Richard,
    Have you tried redirecting the script output in the cron to see if an error is being reported?
    I.e.
    02 17 * * * /home/user/crons/loadbackup.sh > /tmp/loadbackup.log 2>&1

  • When I click on Update, the "Connecting to Server" runs and does not stop or seem to connect. What to do?

    Recently I upgraded to Firefox 4. Since then, at least once a week, I get a message to update, but when I click on "update" a message "connecting to server" appears that runs and runs and nothing else happens. No update! I don't know what to do.

    If you have problems with updating then best is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

Maybe you are looking for

  • Decimal places in excel

    Hi,    I am sending quantity field to excel with three decimal places but when I open the excel after generating it shows only two decimal places.How can i obtain this function with excel it should show only 3 decimal places with thousand seperator.

  • Import project from older version of GB

    Hey all , just wondering if I can import a song I was working on in GB 11 into GB 10 so I finish there. Any help would be great. Thanks, Jim.

  • Widgets Won't Launch

    When I open Dashboard and click on a widget the widget flickers on my desktop for a fraction of a second but won't stay there. If I click on manage my widgets the panel flickers briefly but won't stay either. I tried reinstalling dashboard using Paci

  • Ldap - how to check how many users are connected?

    Hi Guys, Please help me. We have iPlanet installed using LDAP. I want to check in ldap console that how many users are connected currently and monitor that. please tell me how can i do it thanks

  • Where can i find the sample instruments in logic pro x.the proper plugins

    Where can i find the sample instruments in logic pro x.the proper plugins. or third party plugins too where can i find them and how in logic pro x can anyone help me please.