Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use ROBOCOPY command whithin a Vault backup script.

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Mario-Villada
6552 Views, 6 Replies

Use ROBOCOPY command whithin a Vault backup script.

Hi all,

I wonder if it is possible to include a robocopy command inside the vault backup script. what I want to do is to create a backup in the the server hosting ADMS and then make a copy of the backup to a network location. something like this:

 

*********************************************************************************************************

@ECHO OFF

REM DELETE B AND CASCADE A BACKUP SUBDIRECTORIES

RMDIR /Q /S "C:\Backup\Vault\B"

REN "C:\Backup\Vault\A" "B"

REM CREATE A NEW DIRECTORY FOR THE BACKUP

MKDIR "C:\Backup\Vault\A\"

REM START THE BACKUP PROCESS

"C:\Program Files\Autodesk\Data Management Server 2009\ADMS Console\Connectivity.ADMSConsole.exe" -Obackup -B"C:\Backup\Vault\A" -VUadministrator -VP -S

 

REM COPY BACKUP FOLDER TO NETWORK LOCATION

robocopy "C:\Backup\Vault\A" "D:\Backup\Vault\A" /MIR /W:20 /R:15

robocopy "C:\Backup\Vault\B" "D:\Backup\Vault\B" /MIR /W:20 /R:15

***********************************************************************************************************

I did try this last night. It created tha backup successfully in the local server, but it did not copy the files to the network location. In this case 😧 is a mapped drive to a different server.

the script is saved at the root of C: and it runs at night with windows task scheduler with the option of running the task regardless if the user is logged in and with highest privileges.

 

I also tried runnig the robocopy command directly in the command prompt and it works fine.

 

Can anyone see what is wrong?

 

Thanks in advance.

 

Vault Basic 2014 - Windows 7 professional 64 bit - 32 GB Ram

 

6 REPLIES 6
Message 2 of 7

hey there,

2 points:

a) use the /LOG command to see why it is failing within robocopy Robocopy Reference

 

b) is D:\ as network share mapped with the user you are executing it and is it mapped with /persistent switch!?

 

and for sure - make sure the user you use to execute the script has access on the other server.

 

HTH
Hannes



HTH
Johannes Bauer

Customer Technical Successt
Message 3 of 7

Thanks Hannes!

I added the /log switch to the command. nice tip!

As per the robocopy reference link I replaced 😧 for \ \servername\foldername maybe it  works. I will let you know tomorrow.

 

How can I check if the drive is mapped with the /persistant switch?

Message 4 of 7

Hi Mario,
\\servername\foldername will work if you have proper permissions for sure!

are you executing the script as the same user who has mapped D:\?`

you could check using wmic netuse - there is a persistent mark on the connection.
anyhow the \\servername\foldername will work with proper permissions.

what I see with UAC - if you execute a cmd window (or robocopy) as administrator or another user, you do not have the same network shares mapped as the user you are logged in.

BR
Hannes


HTH
Johannes Bauer

Customer Technical Successt
Message 5 of 7

Thanks for the quick reply.
Yes is the same user that mapped D drive.
I will check the permissions, it looks like that's where the problem is.
thanks again.
Message 6 of 7
ryan
in reply to: Mario-Villada

If the server you are backing up to is Linux-based you may need to add the following switches; /COPY:DT /FFT

 

EDIT: Apparently putting colon followed by the letter D is rendered as a smiley face on the message board.  Therefore the line above should be /COPYCOLONDT /FFT

 

-Ryan

 

Ryan Small
National Team Leader, Data Management and Software Development
SolidCAD, a Cansel Company (an Autodesk Platinum Partner)
www.solidcad.ca
Message 7 of 7
Mario-Villada
in reply to: ryan

Thanks guys, It worked!

Checking permissions and using \\servername\foldername instead of the mapped drive letter did the trick.


Thanks Ryan for the advice. It is a windows server in my case but for sure it will help others. And now I know how to put smiley faces in my comments Smiley Happy  .

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report