Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
12 replies
Subscribers
5 subscribers
Views
4549 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hi all, I am trying to run a script (for ex: <Appian_Home>\\cleanup.b
sikhivahans
over 10 years ago
Hi all,
I am trying to run a script (for ex: <Appian_Home>\\cleanup.bat <parameters>) from "Command Line Execution" smart service. The error I am seeing in the "standard error"(output of smart service) is as follows:
'exports.bat' is not recognized as an internal or external command,operable program or batch file.'exports-ant.bat' is not recognized as an internal or external command,operable program or batch file.The system cannot find the path specified.'ant' is not recognized as an internal or external command,operable program or batch file. Am I missing anything here?
Could anyone clarify me regarding the configuration smart service?...
OriginalPostID-83280
OriginalPostID-83280
Discussion posts and replies are publicly visible
0
sikhivahans
over 10 years ago
TIA,
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Patty Isecke
Appian Employee
over 10 years ago
It looks like the Smart Service can only call the one command that you provide. Cleanup.bat calls export.bat, resulting in the message you are seeing.
If you are trying to run a scrip to delete kdb files, you can use a Windows Scheduled Task, a cron job, or a Job Scheduler calendar to run this script at least once-a-week for system maintenance. For more information, check out:
forum.appian.com/.../Data_Maintenance
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 10 years ago
@patty.phonemany, Thanks a lot for the quick response and suggestions. Are you sure regarding this? Because I want to run the maintenance of the server like an application by providing a good UI. And Currently We are working on Appian 7.x. Does this matter? Prior to this post, I have already worked in the way you suggested. What I did was, I provided the cleanup.bat file as an input to task scheduler and configured the parameters in such a way that the backup will be stored in a folder. When the scheduler was run, in the history of the task scheduler I saw the output of the task as success but I didn't saw any output i.e. I didn't see any backup files in the target folder. The same script, when I ran it from command prompt, I was able to see the backup files in the target folder. Am I doing any mistake?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Myles Weber
Appian Employee
over 10 years ago
cleanup.bat should be run from the OS as a scheduled/cron'd job, not via a smart service.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 10 years ago
@myles.weber, Thanks for the suggestion, but my question was still unanswered. Could you please let me know where I did the mistake in configuring the windows task scheduler to run the cleanup script?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jamesw353
over 10 years ago
The specific error you are receiving is because the working directory of the command is not able to see the exports.bat script. This is standard windows stuff. To get this to work you will need to change the working directory to the Appian scripts folder before calling the cleanup.bat script. One way to do this is calling the cleanup.bat script from another bat script preceded by changing the directory to the Appian scripts directory (ie cd <Appian_home>\\server\\_scripts ). That said I would still use the windows scheduler/cron to make the call. I'm on mobile right now, so I'm may be mistaken on some details. I can double check when I get back to the office.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 10 years ago
@jamesw353 Thanks a lot, It would be very helpful if you let me know how to get the Appian scripts directory as pwd and there after call the script so that it works from smart service. Also could you please let me know if I did any mistake in configuring windows task scheduler?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 10 years ago
Sikivahan, when creating the task these are my configuration options:
I browsed and chose cleanup.bat, so the Program/Script listing was:
C:\\appian\\server\\_scripts\\cleanup.bat
Add arguments:
data -delete -keep 2
Start in:
C:\\appian\\server\\_scripts
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 10 years ago
Lastly, ensure that the scheduled task is set to run whether user is logged on or not and that this user has the privileges to run the command.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jamesw353
over 10 years ago
@michael.tan What he said. Here's a screenshot and the lines in the script that you need. Setting the "Start In" option on the action screen to the scripts directory accomplishes the same thing as "cd". I just have it in my script because they are all managed and can be called independent of the scheduler.
Task Setup: http://i.imgur.com/KVzexfZ.png
Action Setup: http://i.imgur.com/uvnY3Rl.png
Script lines:
cd C:\\appian\\server\\_scripts
call C:\\Appian\\server\\_scripts\\cleanup.bat data -target E:\\data -keep 2
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>