Use of EXEC in scripts

Discussion in 'Paragon Drive Backup Product Line' started by Slaycock, Oct 10, 2010.

Thread Status:
Not open for further replies.
  1. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    I am trying to add commands to a backup script to also shutdown the network drive as well as the pc.

    I've added the two lines to the backup script

    exec c:\windows\system32\plink parameters "-ssh -pw freenas root@192.168.2.15 shutdown -p now" endparameters
    exec c:\windows\system32\plink parameters "-ssh -pw freenas root@192.168.2.18 shutdown -p now" endparameters

    based on reading the relatively useless scripting manual.

    Naturally the above two lines don't work else I wouldn't be leaving this message.

    Can anyone edit the above two lines to show me how they do work.
     
  2. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    So, not much point in upgrading from the Free to a Paid version if a simple question cn't be responded to within a month.
     
  3. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    Slaycock,

    I have not tried this command yet, but

    The scripting manual indicates that the keyword FILE is required.

    See if it works if you add the keyword as follows:

    exec file c:\windows\system32\plink parameters "-ssh -pw freenas root@192.168.2.15 shutdown -p now" endparameters
    exec file c:\windows\system32\plink parameters "-ssh -pw freenas root@192.168.2.18 shutdown -p now" endparameters


    P.S. Curious to know if it works.
     
  4. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    No. Your suggestion does not work. The pathname needs to be in "" "" to prevent errors, but still does not run.

    The command

    exec file "c:\windows\system32\shutdown -s -f -t 120 "

    Does run as expected after a short delay, so I am perplexec as to why the plink commands do not run.
     
  5. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    One last thought, are you running the Paragon Script in "GUI mode" or "Command Console (character) mode ?

    .... It might make a difference. Script probably should be run under paragon's command console mode.

    .... In order to run your Paragon Script in Command Console (Character) Mode, delete the Switch --graph following "Scripts.exe" on the Run Commnad line assigned to your Windows Task Scheduler - Task which corressponds to your Scheduled Paragon Script. (Fyi, in case you did not realize, scripts scheduled under paragon use the windows task scheduler.)
     
  6. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    I removed --graph and now tasks don't run at all.
     
  7. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    Further to the above.

    If I call a cmd file from within a paragron script file using

    exec file "C:\Shutdown.cmd"

    which contains the three lines

    c:\windows\system32\plink -ssh -pw freenas root@192.168.2.15 shutdown -p now

    c:\windows\system32\plink -ssh -pw freenas root@192.168.2.18 shutdown -p now

    c:\windows\system32\shutdown -s -f -t 120

    Then the third line runs OK and shutsdown the Windows 7 pc but the two plink commands have no effect. If I run Shutdown.cmd file from the Windows desktop or command line the two servers and the Windows PC ashutdown as expected.

    Anyone have any suggestions as to what is happening.
     
  8. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    Slaycock,

    I would suggest that you contact Paragon Support to address the technical issue.

    ... As a workaround, why not just create a .cmd/.bat file with a first line that executes the paragon backup script (with script only containing the backup process). Copy the script line with switches from your existing windows task scheduler - paragon script task.
    .... Next, lines 2 and 3 of your .cmd file would be your "plink" commands (that will execute when line 1 - paragon script completes its execution). Just schedule the .cmd file in windows task scheduler to execute.

    Now, since your scheduled .cmd file be executing directly under a native windows command console window environment, your plink commands should also work.
     
  9. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    JosephB

    Thanks for your help. Tasks see to be running fine now after I added them back in. However the behaviour does seem odd. Particularly when you consider that a trial version of Norton Ghost ran flawlessly for the trial period on the same machine.

    I don't see my machine as having any strange or esoteric setup so whilst it is nice to have a free backup program, I'm afraid I'm spending too much time fiddling and consequently don't trust it to provide a reliable backup. Consequently I'll be deleting it from my hardrive later today.
     
  10. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    Slaycock,

    FYI, I have been using the paid verision, B&R 10 Home, and I have found it to be very reliable (weekly backups for about 6 months). You might want to reconsider your decision and go for the paid version for your needs. According to the Paragon Home Page they off a 30 day money back guarantee. The B&R 10 paid version comes with a WinPE 3.0 recovery disk which has large hardware support and paragon's web page official support (you have it free for a limited time with your puchased product) to be excellent and quick to respond.
     
  11. Slaycock

    Slaycock Registered Member

    Joined:
    Mar 17, 2007
    Posts:
    33
    I have the paid for version of the Hard Drive Suite which includes simple backups. I'll be using this for doing weekly attended backups in parallel with automated daily backups by another package, very probably Norton Ghost, as I previously gave up on Acronis products for their instability.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.