Computer Help forum

General discussion

Backups by date

Today i setup an automatic backup task in task scheduler to backup my outlook calendar.
I have it set up to backup every night @ 2:00 AM.
I was just wondering if there was any way to make something that would automatically name the different backups by date or anything, like if something happened, i could go back to a week-old backup and load that?
I created a batch file from this website:
http://www.jakeludington.com/windows_xp/20061026_how_to_automatically_backup_outlook.html
i had to tweak it a little bit for vista, but it appears to run successfully when i tested it.
(sorry if outside links are discouraged or something...)
So all in all, i want to know if there is a way to automatically name files by date, and also if there is a way to automatically monitor a folder to delete files older than say, 2 weeks?
Thanks all,
jimmypetran

PS:
I'm running Vista SP1

Discussion is locked
You are posting a reply to: Backups by date
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Backups by date
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
again

In reply to: Backups by date

this is what i need to know:

Is it possible to automatically name files by date?

Collapse -
I'm assuming

In reply to: again

Collapse -
Easy to do ...

In reply to: again

by scheduling the following batch file (which you have to create) to run following the backup completion.

Just copy ALL the bolded text into NOTEPAD and save it as Date-it.bat --

@ECHO OFF
IF %1.==. GoTo ERROR
Set XDATE=%TEMP%\TDATE.TMP
DATE /T > %XDATE%

Set PARSETDATE="eol=; tokens=1,2,3,4* delims=/, "
REM For /F %PARSETDATE% %%i in (%XDATE%) Do SET YYYYMMDD=%%l-%%k-%%j
For /F %PARSETDATE% %%i in (%XDATE%) Do SET MMDDYYYY=%%j-%%k-%%l

rem RENAME %1 %YYYYMMDD%%.*
RENAME %1 %MMDDYYYY%%.*
GoTo END

:ERROR
ECHO.
ECHO Improper Syntax for this command
ECHO.
ECHO SYNTAX: DATE-IT.BAT {file.name}
rem ECHO Renames filename to YYYY-MM-DD{extension}
ECHO Renames filename to MM-DD-YYYY{extension}
GoTo END

:END
del %XDATE%

Set XDATE=
Set PARSETDATE=
Set YYYYMMDD=
REM


You will notice that the syntax requires the name of the file to be renamed to be part of the scheduled command so you will have to provide that file name and the complete path to it.

Collapse -
Thank you!

In reply to: Easy to do ...

hey thanks a lot Edward ODaniel!
I am not even going to pretend to be an expert here... so where in this file do i provide the filepath/name? is it after
Set XDATE=
?

thanks, jimmypetran

Collapse -
You do it in the batch file you create ...

In reply to: Thank you!

and use with the scheduler service that calls this one for the actual renaming. For instance if the backup file is ALWAYS named mybackup.bak when it is created and it is always created in C:\data\mybackups\ you would create a batch file named rename_bak.bat (or whatever trips your trigger) and it would consist of:

@echo OFF
Date-it.bat "C:\data\mybackups\mybackup.bak"
(with the portion in italics being the actual path and filename to your backup files)

If you can't handle the editing and creation of a batch file for scheduling then it is easy to do it manually by placing a copy of the date-it.bat right on the desktop and running it manually from a command prompt.

Popular Forums

icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

SMART HOME

This one tip will help you sleep better tonight

A few seconds are all you need to get a better night's rest.