How to schedule eMAM DB backup using Task scheduler?

How to schedule eMAM DB backup using Task scheduler?

Download the patch from the below FTP location
UserName : clients
Password : Emam@2025!Ftp#

Download Database_Auto_Backup_04AUG2021.zip  from the folder SCRIPTS
Once the patch file is downloaded, follow the steps below :
  • Extract the downloaded zip file and place the extracted folder  in C:\Program Files\EmpressMedia folder and rename it to Database_Auto_Backup
  • Open the Execute.bat file in a text editor.
  • Set the database name (dbname), database user id (uname), and database password (pwd).
    • dbname : emamdb
    • uname: emam
    • pwd: password
  • Edit the value of the parameter "backuplocation" which is the destination location. It can be a local or network shared location. 
    For example, if you need the emamdb backup inside D:\Backup\DB folder, then the parameter should be given as set backuplocation='D:\Backup\DB\'. (Don't forget to add the \ at the end, if not, the DB backup will be created inside D:\Backup). See the image below for reference.



  • Save and run the Execute.bat file.
  • Open the Execute.bat file in a text editor again.
  • Remove osql -S %svr% -d %dbname% -U %uname% -P %pwd% -i "proc_AutoBackupDatabases.sql"  -o "proc_AutoBackupDatabases.txt"  -n line from the script. PFA snap.



  • Save the file.
  • Open Windows Task Scheduler and create a new task.
  • Provide name under the General tab and select 'Run whenever user is logged on or not' in Security options
  • Go to Trigger tab, Create a new trigger (when should the backup occur, Daily, Weekly, monthly or any specific time).
  • Go to Actions tab, Create new Action 
    • Action -> Select a program
    • Program/Script -> Browse the location where Exectue.bat file exist. e.g: "C:\Program Files\Empress Media\Database_Auto_Backup\Execute.bat" (Do not remove the double quotes)
    • Start in -> Paste the location were Execute.bat exist (Don't add Execute.bat). e.g: C:\Program Files\Empress Media\Database_Auto_Backup\
  • Hit OK, the Task will be created. You can test the script by hitting the 'Run' option.
For any further assistance, please get in touch with eMAM Support at support@emamonline.com