- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 11:54 AM
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
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 09:14 AM
Hi,
you can use post export script and use mid server script include and move the file and then delete it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 01:16 PM
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";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 08:34 PM
Hi
you could use the rsync command: https://linuxize.com/post/how-to-use-rsync-for-local-and-remote-data-transfer-and-synchronization/
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 09:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 09:14 AM
Hi,
you can use post export script and use mid server script include and move the file and then delete it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 10:55 AM
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