This project has moved. For the latest updates, please go here.

Backup Settings options

Aug 28, 2014 at 7:43 PM
Edited Aug 28, 2014 at 7:50 PM
Adding a datetime stamp as a suffix to the backup pst file would allow multiple backups in the same destination folder without overwriting the previous backup. This would give heavy users more confidence when deleting emails.
Coordinator
Aug 30, 2014 at 10:33 PM
You can run a skript as post-backup-command.
Just create a little batch file which will do the work for you (tested with German date format):

@ECHO OFF
setlocal EnableDelayedExpansion
set dt=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%

FOR /F "delims=" %%I IN ('DIR *.pst /B') DO (
set x=%%I
ren "!x!" "!x:~0,-4!_%dt%.bak"
)


Just place the batch-file into the backup directory and let it run automatically after backup.
This will rename all pst files to bak-files and add a date.
Aug 31, 2014 at 4:25 AM
Thanks, Thomas. I'll give it a try. Sent from my iPad
Sep 24, 2014 at 8:27 AM
Edited Sep 24, 2014 at 8:28 AM
i try it but:
"Error executing ***.bat Das System kann die angegebene Datei nicht finden"
i have place the batch-file into the backup directory but it not run.
Manuel executing is ok (so the Batch-File works fine) but the Addin can not find the Batch.

greetings,
Frank, aus Düsseldorf
Coordinator
Sep 25, 2014 at 5:41 AM
Hello Frank,

please enter the full path to the bat-file.
E.g.
Post backup cmd:
c:\programme\addsuffix.bat
Sep 25, 2014 at 3:47 PM
ok, if i enter the full path to the bat-file, the add-in find it and start the bat file,
but there is a second problem:
the path (for me) is "D:\Daten-Programme\Outlook"
but the command-promt startet in "C:\Users\Frank\dokuments"
so the error is: "can not find file (Datei nicht gefunden)"

no problem for me, because i change the first line of the script with
cd [/D] [Laufwerk] [Pfad] , for me:
"cd /D D:\Daten-Programme\Outlook"

so the sripct startet in the right path and everything is fine. Thank you.
Coordinator
Sep 25, 2014 at 6:50 PM
Hello Frank,
I am glad it worked!
I added the script to the documentation area of this site including your first command.
Jan 12, 2016 at 11:29 AM
I have problems with this script and hope to help.

my bat file:

@ECHO OFF
setlocal EnableDelayedExpansion
set dt=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%

FOR /F "delims=" %%I IN ('DIR *.pst /B') DO (
set x=%%I
ren "!x!" "!x:~0,-4!_%dt%.bak"

)

Backup addin options:
http://img905.imageshack.us/img905/2401/3AzDkw.png

Error:
http://img907.imageshack.us/img907/835/yuCd59.png

Thanks
Coordinator
Jan 13, 2016 at 7:11 PM
Edited Jan 13, 2016 at 7:12 PM
Hello,

please add one line to change to backup directory (e.g. after "echo" line):
cd /d "E:\EMAIL BACKUPS"

Otherwise the dir-command wont find any pst files.

Then it should work.

Kind regards,
Thomas
Jan 14, 2016 at 5:05 AM

ok, my new bat file:

Post backup cmd: cd /d "E:\EMAIL BACKUPS"
@ECHO OFF
setlocal EnableDelayedExpansion
set dt=%DATE:~6,4%.%DATE:~3,2%.%DATE:~0,2%

FOR /F "delims=" %%I IN ('DIR *.pst /B') DO (
set x=%%I
ren "!x!" "!x:~0,-4!__%dt%.bak"

)

Error:
http://img905.imageshack.us/img905/7426/bljZTI.png
Coordinator
Jan 14, 2016 at 5:43 AM
Edited Jan 14, 2016 at 5:43 AM
Hello,

the whole batch-file should look like this:


cd /d "E:\EMAIL BACKUPS"
@ECHO OFF
setlocal EnableDelayedExpansion
set dt=%DATE:~6,4%.%DATE:~3,2%.%DATE:~0,2%

FOR /F "delims=" %%I IN ('DIR *.pst /B') DO (
set x=%%I
ren "!x!" "!x:~0,-4!__%dt%.bak"
)


The error says it cant find the file
"E:\EMAIL BACKUPS\AddSuffix.bat"

Please check whether the path and filename are ok.
You can omit the double quotes.

Kind regards,
Thomas
Jan 14, 2016 at 5:52 AM
Edited Jan 14, 2016 at 6:00 AM
I dispair....

Error:
http://img905.imageshack.us/img905/4574/HeZGmp.png



It works now. :)
Coordinator
Jan 14, 2016 at 7:06 PM
Hello,

it seems you wrote "post backup cmd ..." in your script (?)
You can send me the batch-file via email (contact form).
Then i will check the file.

Kind regards,
Thomas
Jan 14, 2016 at 10:52 PM
Thanks Thomas,
the script is running now. :-)