Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

SM69 External OS command -- Addition of Time Stamp not working.

Former Member
0 Kudos

Hi AIl,

I have to scheduled a background job which will move a file from source directory to archive directory with a timestamp added to the file. So I am using transaction - SM69 to define an external OS command which will be used for job scheduling and details are as follows.

cp /source/file1.txt /archive/file2--`date +%Y-%m-%d_%H:%M`

But while executing the command its throwing following error --

<< cp: target `+%Y-%m-%d_%H:%M`' is not a directory External program terminated with exit code 1>>

the same command is working perfectly with RSDB2CMD report, can any one know the reason of this error?



Edited by: Raks on Jan 26, 2009 10:21 AM


0 Kudos

HI Raks,

Please do concatenation or joining your filename and timestamp before using cp command.

Dont try to combine them in your cp command



Former Member
0 Kudos

Hi Nagendra,

Thanks a lot your reply, yes I am planning to have the 'cp' command inside custom os script in which the timestamp option with cp is working fine or to write a Zreport which will call the standard FM -- SXPG_EXECUTE_COMMAND and passing file name with timestamp has paramter.