The CreatorCon Call for Content is officially open! Get started here.

export set - how to put target path outside Mid server path

fbelghait
Mega Guru

Hi,

  I have a requirement to put the export file generated by the export set outside the mid server.  I am not allowed to use the symlink solution. since it seems that server now do not allow to specify target path outside the Mid Server, I am thinking using a post script to move the file.  

can anyone share a script code that moves the files from the mid server target path to  a mapped drive

 

Thanks

  

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use post export script and use mid server script include and move the file and then delete it

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

fbelghait
Mega Guru

I found the answer. here is an example of code that can be used to put a command in the queue 

 

var ecc = new GlideRecord("ecc_queue");

ecc.initialize();

ecc.agent = "mid.server.MyMidServer2";

ecc.topic = "Command";

ecc.name = "powershell move-item -Path C:\\MidServer\\Mid2\\agent\\export\\*.csv -Destination C:\\Temp";

ecc.queue = "output";

ecc.state = "ready";

View solution in original post

8 REPLIES 8

Hi,

you won't find much example for this as this is a very specific requirement.

you would require knowledge of java packages etc since you will be writing mid server script include.

regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

fbelghait
Mega Guru

Hi,

  Does any one knows where can I find  script example to be called from post export in order to move files from mid server to target folder

fbelghait
Mega Guru

I found the answer. here is an example of code that can be used to put a command in the queue 

 

var ecc = new GlideRecord("ecc_queue");

ecc.initialize();

ecc.agent = "mid.server.MyMidServer2";

ecc.topic = "Command";

ecc.name = "powershell move-item -Path C:\\MidServer\\Mid2\\agent\\export\\*.csv -Destination C:\\Temp";

ecc.queue = "output";

ecc.state = "ready";

But where to write this code in export sets?