JP Vossen via plug on 28 May 2023 11:09:01 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Backing up Windows to Linux [via RoboCopy]


On 5/27/23 02:49 PM, Mike Leone wrote:
On Sat, May 27, 2023 at 2:35 PM JP Vossen via plug <plug@lists.phillylinux.org <mailto:plug@lists.phillylinux.org>> wrote:

    On 5/26/23 06:03 PM, Mike Leone wrote:
     > Well, my default command is this, I just edited it for the relevant bits of the post:
     > RoboCopy %Source% %Destination%  /MIR /XA:SH /MT:20 /E /ZB /COPYALL /R:1 /W:1 /NS /NC /NP /NFL /NDL /LOG+:%LogFile%

    I assume `/XA:SH` is System and Hidden?  Why omit those?

Don't need them. Usually I use this script when migrating a file server to a newer one. Used it more than a half dozen times that way. The plates versions of Windows have their Admin Center, where you can supposedly automate that type of migration, but I've never gotten it too work clearly, then again, I was trying it with coasters, so ...

Got you, different use-cases then.  Mine is more like Rich's: belt, suspenders, and duct tape...just in case.


Also, I just tried `/ZB` and it was a total fail, because my user doesn't have admin rights.
So just run it was a user who has such rights. 😁 The Windows equivalent of "sudo" is "runas". Although I usually just do it as a scheduled task, and specify the user it runs as, as one that has local admin rights.

The script doesn't *have* to run in the user's context, it just needs to be able to access the files it needs to.
I started to say: but that's not how I use/run it...  But you raise a good point, why *don't* I run it that way?  Well, because I never needed to before now.  I gave a test command a shot and failed.  The redacted admin-user and password ARE correct, and I can and do use them in the GUI if I right-click and "run-as" something.  But CLI use failed.  I would not be surprised if this is locked down somehow.  Actually, I'd be surprised if it wasn't.

```
C:\Users\my-user> runas /env /user:admin-user "w32tm /query /status"
Enter the password for admin-user:
Attempting to start w32tm /query /status as user "admin-user" ...
RUNAS ERROR: Unable to run - w32tm /query /status
1326: The user name or password is incorrect.
```

Rich soled his problem, and we're starting to do down a more Windows-centric rabbit hole here though, so I renamed this.  We probably don't want to spam the list on this much more...  I'll ask some Windows-y folks on my team about this and see what they say.  It's quite possibly I'm doing something wrong.

Thanks for the clues though,
JP
--  -------------------------------------------------------------------
JP Vossen, CISSP | http://www.jpsdomain.org/ | http://bashcookbook.com/

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug