Using Task Scheduler fails to run RoboCopy.

Page 1 of 3 123 LastLast

  1. Posts : 207
    Windows 7 Professional 64bit
       #1

    Using Task Scheduler fails to run RoboCopy.


    I have set up some RoboCopy tasks that run fine when run from the desktop link, but being forgetful I thought I would try to run them automatically using Task Scheduler. I followed the instructions in the tutorial and all appeared to be fine. However the tasks did not run so I checked them in Task Scheduler and last run stated 'Never'. I then chose to 'Run' them Task Scheduler and got the following dos report:

    (The smiley is ColonD at)


    REPORT:
    Simple Usage :: ROBOCOPY source destination /MIR
    source :: Source Directory (drive:\path or \\server\share\path).
    destination :: Destination Dir (drive:\path or \\server\share\path).
    /MIR :: Mirror a complete directory tree.
    For more usage information run ROBOCOPY /?
    **** /MIR can DELETE files as well as copy them !
    C:\Windows\system32>robocopy "C:\Program Files (x86)\Microsoft Money 2005" "K:\M
    oney File Backups" /e /np /tee /mt:4 /log+:my_backup_log.txt
    2014/01/03 10:25:38 ERROR 5 (0x00000005) Opening Log File C:\Windows\system32\my
    _backup_log.txt
    Access is denied.

    -------------------------------------------------------------------------------
    ROBOCOPY :: Robust File Copy for Windows
    -------------------------------------------------------------------------------
    Started : Fri Jan 03 10:25:38 2014
    Source - C:\Program Files (x86)\Microsoft Money 2005\
    Dest - K:\Money File Backups\
    Files :
    Options : /TEE /S /E /COPYAT /NP /MT:4 /R:1000000 /W:30

    ------------------------------------------------------------------------------
    ERROR : Invalid Parameter #7 : "/log+:my_backup_log.txt"
    Simple Usage :: ROBOCOPY source destination /MIR
    source :: Source Directory (drive:\path or \\server\share\path).
    destination :: Destination Dir (drive:\path or \\server\share\path).
    /MIR :: Mirror a complete directory tree.
    For more usage information run ROBOCOPY /?

    **** /MIR can DELETE files as well as copy them !
    C:\Windows\system32>robocopy "C:\Users\Alan\Documents\Outlook Files" "K:\Outlook
    Files - NEW 21 03 2012" /e /np /tee /mt:4 /log+:my_backup_log.txt
    2014/01/03 10:25:38 ERROR 5 (0x00000005) Opening Log File C:\Windows\system32\my
    _backup_log.txt
    Access is denied.

    -------------------------------------------------------------------------------
    ROBOCOPY :: Robust File Copy for Windows
    -------------------------------------------------------------------------------
    Started : Fri Jan 03 10:25:38 2014
    Source - C:\Users\Alan\Documents\Outlook Files\
    Dest - K:\Outlook Files - NEW 21 03 2012\
    Files :
    Options : /TEE /S /E /COPYAT /NP /MT:4 /R:1000000 /W:30
    ------------------------------------------------------------------------------
    ERROR : Invalid Parameter #7 : "/log+:my_backup_log.txt"
    Simple Usage :: ROBOCOPY source destination /MIR
    source :: Source Directory (drive:\path or \\server\share\path).
    destination :: Destination Dir (drive:\path or \\server\share\path).
    /MIR :: Mirror a complete directory tree.
    For more usage information run ROBOCOPY /?


    END.


    I entered ROBOCOPY/? in the Win7 search box but got no help screen.


    The above only shows a proportion of the commands set up in RoboCopy so I reckon it gave up trying to run and reported only the above errors, only a guess though!


    Any suggestions as to what may be wrong based on the above report?

    These are some of my RoboCopy lines:
    robocopy "I:\DATA" "K:\DATA" /e /np /tee /mt:4 /log:my_backup_log.txt
    robocopy "C:\Program Files (x86)\Microsoft Money 2005" "K:\Money File Backups" /e /np /tee /mt:4 /log+:my_backup_log.txt
    robocopy "C:\Users\Alan\Documents\Outlook Files" "K:\Outlook Files - NEW 21 03 2012" /e /np /tee /mt:4 /log+:my_backup_log.txt
    robocopy "C:\Users\Alan\AppData\Roaming\Mozilla\Firefox\Profiles\00nrkh7f.default" "K:\Mozilla File Backups" /e /np /tee /mt:4 /log+:my_backup_log.txt
    robocopy "C:\Program Files\Microsoft Office\Office14\Queries" "K:\Queries Alans Address Book 02.xls" /e /np /tee /mt:4 /log+:my_backup_log.txt

    Many thanks
    Alan.
      My Computer


  2. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #2

    Code:
    2014/01/03 10:25:38 ERROR 5 (0x00000005) Opening Log File C:\Windows\system32\my
    _backup_log.txt
    Access is denied.
    I think the basic problem is you are trying to save the logfile to a Windows protected folder.

    My suggestions is to use your robocopy bat file from your desktop....not C:\Windows\system32\

    Try that and let us know what happens.

    BTW : you run robocopy /? from an elevated command prompt as explained in the tutorial - not from Windows search.
      My Computer


  3. Posts : 207
    Windows 7 Professional 64bit
    Thread Starter
       #3

    Thank you for the fast reply Golden, I can run the file manually without any problems from my desktop but I would like to use Task Scheduler to run it on a regular basis, I would really like it to run as shutdown if that is possible but it seems I can only chose a time and run asap if a run is missed.
    I am printing off the tutorials about backups and images as I do not seem to have an actual windows backup set up yet!
    I have just bought a 2TB WD My Passport drive for system and file backups, now I just need to find out what will be best.

    Regards
    Alan.
      My Computer


  4. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #4

    No worries Alan......another option is SyncToy. May be a little easier for you?

    SyncToy - Backup User Data
      My Computer


  5. Posts : 207
    Windows 7 Professional 64bit
    Thread Starter
       #5

    Thank you for the link to Synctoy, I have printed off the tutorial and will read it as soon as I can, I may be back with a few ???'s so be ready!

    Thanks again.

    Alan.
      My Computer


  6. Posts : 207
    Windows 7 Professional 64bit
    Thread Starter
       #6


    I have installed SyncToy and printed off the tutorial. I note in step 1 of 'Using SyncToy' it shows to choose your folders, I selected a left folder named I:\DATA. I: is my main external drive which has a folder named DATA and made a new folder in my external 2TB M: drive called Synctoy DATA. I selected this new folder as my right folder. (M:\Synctoy DATA).

    My I:\DATA folder contains about 15 sub folders each with its individual files, around 700 across these sub folders in total and as suggested used the ECHO option. I named the pairing of folders as 'I DATA Backups'.

    I previewed the I DATA Backups in Synctoy and instead of 15 folders I found 700 files, if I did this with my music folder containing around 60 sub folders with about 30~50 songs in each that would mean a listing of 2,000+ plus songs. I have many other folders with sub folders I wish to back up as they are.

    Is it possible for Synctoy to maintain my existing folder structure in the backup and not extract every sub folder file? Or, would I need to 'pair' every folders 'sub folder' on a one to one basis? A very long and laborious task! If so I think I may be better off with with Robocopy and hope I can find a way to use Task Scheduler to run it automatically. Or put up a post-it note to remind me.

    I prefer to have exact and direct copies not compressed or in a format that needs another program to open them.

    Thanks for your help.
    Alan.
      My Computer


  7. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #7

    Alan,

    1. Please copy the text in the code box below to a new instance of Notepad.
    2. Save the file as test.bat on your desktop
    3. Right-click on test.bat and run as administrator

    It should backup everything in I:\Data to your M: drive in a folder called \Backup_DATA. Please report back if it does that.

    Code:
    robocopy I:\DATA M:\Backup_DATA /e /mir /np /log:backup_log.txt
    pause
      My Computer


  8. Posts : 207
    Windows 7 Professional 64bit
    Thread Starter
       #8

    Hi Golden.
    Thanks for your reply.

    I did as you suggested and the I DATA file was copied to my M drive correctly. Thank you.

    I would like to be able to set Task Scheduler to run the scripts as in my post 1 automatically but something is not working, if I (you? ) can sort out what the problem in Task Scheduler is then I will be a very happy bunny.

    Thanks
    Alan.
      My Computer


  9. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #9

    Alan leave it with me for a day or so, and I'll work it out
      My Computer


  10. Posts : 207
    Windows 7 Professional 64bit
    Thread Starter
       #10



    Thank you, your help is very appreciated!

    Regards

    Alan.
      My Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:45.
Find Us