cancel
Showing results for 
Search instead for 
Did you mean: 

--exportPath=/TREX_SID_Backup/%Y%m%d doesnt work

Former Member
0 Kudos

Hi Experts,

I had it to work once, but now i cant get it to work anymore. I have no clue whats going on. Instead of adding more gray hair ill see if someone here can spot my mistake. Im exporting TREX Indexes and using the guide from SAP Library about TREX Backup.

When i throw this line in my command it only creates a directory under TREX_SID_BACKUP called "md". Can anyone help me fix this?

Im calling this line:


python.exe exportManager.py --indexId=* --exportPath=/TREX_SID_Backup/%Y%m%d --testOnly=1

Its windows server 2008 btw. I got it to work first time it created a directory under TREX_SID_Backup called 20101015 where it saved the index backup. But now it only makes a directory called md.

i hope someone are able to spot my mistake.

Kind Regards,

Soren

Accepted Solutions (1)

Accepted Solutions (1)

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

> python.exe exportManager.py --indexId=* --exportPath=/TREX_SID_Backup/%Y%m%d --testOnly=1

>

You are using --testOnly=1 which means that The system simulates the export. No data is written. However, errors are displayed. This can be useful if you want to see whether or not an export is viable or which errors would occur if you carried out an export.

So, you should use 0 instead of 1. Better don't use testOnly option as it will by default take 0.

Thanks

Sunny

Former Member
0 Kudos

Hi Sunny,

Thank you for your answer.

So youre saying that when I remove the test option it will create the directory properly?

Thanks!

-Soren

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

Yes. You can take backup with this option.

Thanks

Sunny

Former Member
0 Kudos

hi Sunny,

Thanks again!

I still experience problems - the backup is successful, but the Directory created is still wrong. When I define export path --exportPath=/TREX_Backup/%Y%m%d the directory should be:

\TREX_Backup\20101025

But instead the index gets saved in:

\TREX_Backup\md

I am unable to figure out why it doesnt work. I would think it would be because the python.exe isnt open or something like that since it cant resolve "%Y%m%d"

I had it to work one time, but I cant remember how the h*** I did it. If anyone has an idea please let me know

Thanks in advance,

Soren

Former Member
0 Kudos

Hi Everyone,

I found out how to provoke the error. if I run the commandline from a .BAT file in a command prompt it fails. If I run the same commandline from the same command prompt it works and it is creating the directories as intended. Why doesnt "/%Y%m%d" work from a .BAT file?

Thanks!

-Soren

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

Since you are giving path /TREX_SID_Backup/%Y%m%d this in .bat file. How it will identify that there is further sub-directory in /TREX_SID_Backup ?? I think you should give complete path.

When you run it manually, do you give same path /TREX_SID_Backup/%Y%m%d and it take backup in 25102010 folder ??

Thanks

Sunny

Former Member
0 Kudos

Hi Sunny,

Its very strange, it works if I copy the commandline from the .bat file and paste it into a command prompt. Backup is stored in the 20101025 folder. If I run the .bat file in the same command prompt the backup is stored in "md" folder. Is it some syntax which needs to be correct when making the .bat file? It is as if the .bat file doesnt recognize the syntax for the folder - I guess the %Y%m%d is a python.exe command.

Any suggestion is much appreciated!

Kind Regards,

Soren

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

I am not sure, since I have not tried TREX backup from bat file. May be you can try to replace "/" to "\" because window take this \ as separator.

means path should be like: \TREX_Backup\%Y%m%d

Thanks

Sunny

Former Member
0 Kudos

hi Sunny,

Got it to work, Just had to put double % in the command line (TREX_SID_Backup/%%Y%%m%%d) and it works. Thanks for your help!

Kind Regards,

Soren

Answers (0)