I have a Shell Script under which restore command is mentioned for restoring the DB from target folder. My File name will be mongorestore.sh
NOTE: Dump data location will be E:Backup/test
#!/bin/sh DEST="Location where my backup is stored" mongorestore -h 127.0.0.1:27021 -d secondary "E:Backup/test/dbname"
NOTE: If I will double-click on this shell file then it will restore the backup. But it will not be done through schedule task. Schedule Task CMD will Open And then Instantly closed. Not able to get the error also. Already Checked on Schedule task log file but there is no error.
And I will Create the Schedule task for invoking this file for creating the restore process. But it will not do. Even I am not able to see the error. As it open and instant close. If anyone has any idea regarding this?
And please check whether my command will be right or not. Any help is really appreciated.
My mongodump Script file will be:
#!/bin/sh DIR=`date +%m%d%y` DEST="E:Backup/test/$DIR" mkdir $DEST mongodump -h 127.0.0.1:27017 -d myDbName -o $DEST
It was working fine