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

Maik Skoddow
Tera Patron
Tera Patron

fbelghait
Mega Guru

Hi,

Unfortunatly canniot yuse rsync , the mid server is on wondows , in addition to that, the file should be removed from the source destination once copied into the destination directory

 

 

 

 

  

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

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