Auto Daily Backup

Discussions on webmail and the Professional version.
Post Reply
rockinthesixstring
Posts: 844
Joined: Mon Dec 05, 2005 7:51 am
Location: Canada

Auto Daily Backup

Post by rockinthesixstring » Mon Jul 31, 2006 11:42 pm

Hello All
I have created a small batch file that runs the backup for ME every night

Code: Select all

REM *** Starts Here (MEBak.bat)***
mebackup /BACKUP /NOLOGS
Rem *** Ends Here ***
what i want is for it to place the backup in the dated folder so that i have a FULL backup set for each day.

IE
20060731MEBackup/
20060730MEBackup/

Does anyone have a solution for this?

i read that you have to change the backup directory in the registry, but i dont like that idea
Chase
Server 2008 Standard (x64)
ME Ent 6.51 (SQL Server 2008 Config)
ASSP 1.9

rockinthesixstring
Posts: 844
Joined: Mon Dec 05, 2005 7:51 am
Location: Canada

Post by rockinthesixstring » Tue Aug 01, 2006 3:33 pm

does the mebackup utility simply copy the critical directories or does it ignore some stuff?

if it doesnt ignore anything within the directory i can probably write a simple batch file to copy stuff

if it does ignore stuff, what stuff does it ignore?
Chase
Server 2008 Standard (x64)
ME Ent 6.51 (SQL Server 2008 Config)
ASSP 1.9

rockinthesixstring
Posts: 844
Joined: Mon Dec 05, 2005 7:51 am
Location: Canada

Post by rockinthesixstring » Tue Aug 01, 2006 3:36 pm

another idea i had would be to have the mebackup utility have a "/DATENAME" switch in order to create a folder that includes the date ...

ie AutoBackup20060801

if the person who wrote the program reads this, what do you think... good idea?
Chase
Server 2008 Standard (x64)
ME Ent 6.51 (SQL Server 2008 Config)
ASSP 1.9

rockinthesixstring
Posts: 844
Joined: Mon Dec 05, 2005 7:51 am
Location: Canada

Post by rockinthesixstring » Wed Aug 02, 2006 2:39 am

anyone have any thoughts on this?
Chase
Server 2008 Standard (x64)
ME Ent 6.51 (SQL Server 2008 Config)
ASSP 1.9

MailEnable-Ben
Posts: 5858
Joined: Fri Jan 16, 2004 6:49 am
Location: Melbourne

Post by MailEnable-Ben » Wed Aug 02, 2006 5:21 am

The best way would probably be backing up the data and configuration as per this article then you have more control on your naming structure.

http://www.mailenable.com/kb/content/vi ... D=ME020024

You need folders - Config, Dictionaries, Postoffices

Possibly depending on your configuration - logging, bad mail, quarantine, queues
Regards,

Product Services
MailEnable Pty Ltd

To keep track of all ME company updates and version releases you should subscribe to the MailEnable list at http://www.mailenable.com or the RSS feed http://www.mailenable.com/rss.

trusnock
Posts: 132
Joined: Tue Jan 31, 2006 8:42 pm

Post by trusnock » Wed Aug 02, 2006 4:03 pm

I think this is what you're looking for. It simply runs MEBACKUP, then renames the Autoback folder created by MEBACKUP to a name containing today's date. Make sure the destination folder doesn't already exist, or the rename will fail.
-Tom R.


me-backup-log-rotator.bat

@echo off

rem ---------------------------------------------------------
rem ----------------- Backup folder rotator -----------------
rem -
rem - Sample script by Tom Rusnock - trusnock@AcadiaSys.com
rem - 8/2/2006
rem -
rem - Renames the "Autoback" backup folder created by MEBACKUP
rem - to "ME-Backup-MM-DD-YYYY" using today's date.
rem -
rem - Set BACKUPPATH to the location of your backup folders
rem -
rem - NOTE: This script does not check to see if the
rem - destination folder exists already, so if you run
rem - the script more than once during testing, you
rem - must remember to delete the previous destination
rem - folder!
rem ---------------------------------------------------------

rem - Run MEBACKUP:

mebackup /backup /nologs



rem - Set up the variables and rename the folder:

SET BACKUPPATH="D:\Mail Enable\Mail Enable\Backup\Sets"
SET OLDNAME=Autoback
FOR /F "tokens=2" %%i IN ('date /t') DO SET THEDATE=%%i
SET MM=%THEDATE:~0,2%
SET DD=%THEDATE:~3,2%
SET YYYY=%THEDATE:~6,4%
)

IF EXIST %BACKUPPATH%\%OLDNAME% GOTO RENAMEBACKUP
echo %THEDATE% - Backup folder does not exist! >> %BACKUPPATH%\logrotator.log
GOTO DONE

:RENAMEBACKUP
SET NEWNAME= "ME-Backup-%mm%-%dd%-%yyyy%"
RENAME %BACKUPPATH%\%OLDNAME% %NEWNAME%
echo %THEDATE% - Backup file renamed to %NEWNAME% >> %BACKUPPATH%\logrotator.log
:DONE

rockinthesixstring
Posts: 844
Joined: Mon Dec 05, 2005 7:51 am
Location: Canada

Post by rockinthesixstring » Wed Aug 02, 2006 5:44 pm

yeah i came up with this one

Code: Select all

@echo off 

"C:\Batch\MEBACKUP.exe" /BACKUP /NOLOGS

for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do  set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
) 

SET NEWNAME= "Autoback-%dt%%tm%" 
RENAME "C:\SWSoft\Plesk\Mail Servers\Mail Enable\Backup\Sets\Autoback" %NEWNAME% 
with this one, you can run it as often as you like (not just once a day)
Chase
Server 2008 Standard (x64)
ME Ent 6.51 (SQL Server 2008 Config)
ASSP 1.9

Post Reply