Link to home
Start Free TrialLog in
Avatar of VicManuel
VicManuel

asked on

pc support in the server extensions *.doc

Hi, can you help to compile a script to perform backup incremetal only the following files: *. doc, *. txt, *. pdf, *. pst, from a pc to the server \\server\Backup\SERIALNAME\ .. please
Avatar of Mechanic_Kharkov
Mechanic_Kharkov
Flag of Ukraine image

if You use rar archives to backup files, than You can perform such backup with single command line. E.g.
rar a -r -ep3 -n*. doc -n*. txt -n*. pdf -n*. pst -ag \\server\Backup\backup_ c:\ d:\ e:\

this will backup files with given extensions to this folder from disks c, d, e. File pathes inside archive will be full (including drive letter) for later extracting to the same location.
SERIALNAME is not used because the name of archive file itself will be completed with Date/Time stamp of archive creation.

You can write this line to cmd file and put it to scheduled tasks to perform automatic scheduled backup.
There are spaces in line that are unwanted. There is corrected version below:

rar a -r -ep3 -n*.doc -n*.txt -n*.pdf -n*.pst -ag \\server\Backup\backup_ c:\ d:\ e:\
You could XCOPY your files from a DOS command line as in:

FOR %a in (doc txt pdf pst) DO @XCOPY "c:\source\*.%a" \\server\Backup\SERIALNAME /M /H /R /Y /S

or from within a batch file such as:

@echo off
FOR %%a in (doc txt pdf pst) DO (
   XCOPY c:\source\*.%%a \\server\Backup\SERIALNAME /M /H /R /Y /S
)

NOTE 1: Unless the files change between subsequent XCOPYs, they won't copy a second time. So, when testing these methods, you may like to reset their 'archive' attributes in between subsequent XCOPYs by entering the following commands (either from a command line or from within a batch file):

ATTRIB +A *.doc
ATTRIB +A *.txt
ATTRIB +A *.pdf
ATTRIB +A *.pst

This is becasue XCOPY clears a file's archive attribute when used with the '/M' command tail option.

NOTE 2: You can substitute 'c:\source' to whatever folder your files are located in.
Oh, that should be:...

ATTRIB +A "c:\source\*.doc"

etc...
 
Avatar of VicManuel
VicManuel

ASKER

Hey thanks. You can support. Docx? one more thing .. I need to be incremental
Hi I would be most useful in Visual Studio incremental and the following extensions. Doc, docx,. Pst thanks
ASKER CERTIFIED SOLUTION
Avatar of t0t0
t0t0
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What do You mean "incremental"? Create each time new folder in destination with incremental name?
Mechanic_Kharkov

I'm in the process of replying to VicManuel regarding this issue....
t0t0

Also interested to know how to create folder names in batch loop. Waiting for Your solution. Thanks.
Incremental backup is the next look to use the backup are kept only the files that were modified
Incremental backup infers you maintain separate backup jobs for each backup session.

Please read the following very carefully and try to understand what's happening.

Monday. You create a backup for the first time. Because no previous back has yet been created, ALL your files that you target for backup are backed up.

Tuesday. You create another backup, but this time, only files that have changed since Monday's backup are actually backed up (this means nearly all of your files are in Monday's backup set).

Wednesday. You create your 3rd backup. Only files changed since Tuesday are actually backed up.

Thursday. You create your 4th backup. Only files changed since Wednesday are actually backed up.

Friday. You create your 5th backup. Only files changed since Thursday are actually backed up.

The following Monday comes around and it's time to backup again. You already have 5 backup sets normally named "Monday", "Tuesday", "Wednesday", "Thursday" and "Friday".

If you now create a new backup overwriting named "Monday" which over-writes your previous Monday's backup set then you will effectively lose most of your files which were backed up on the previous Monday.

In practice though, backups are normally written to tape. Each backup set is appended to the end of the previous backup set.

Personally, I don't like this method because if Tape 1 (which contains the first backup set) gets coffee spilt over it then you've lost nearly all of your data.

Furthermore, if you have to do a restore, you have to do them in reverse order, starting with the most recent backup set and continue until you've restored every backup set unpto and including your very first backup (the one containing most of your files).

I assume you are backing up to folders to simulate a tape environment. This is not problem because you can simulate a tape environment using named folders. Furthermore, you can also simulate backup sets using date and time stamped sub-folders.

Please do not confuse incremental backup with differential backup.
It would be better if you could describe how you want your backup processes to proceed so that we can model a solution which fits your description.
There are many reasons why you might want to perform incremental backups spread across different days of the week. For example, you may edit a file and some time later, decide to revert to the previous edit. Having incremental backups would enable you to look back through different versions of the same re-edited file.

In one environment I worked in, weekly comparisons were made to assess volume of work produced.

A differential backup provides the fastest restore point should there need to be one. This method relies on a full backup during the first backup run session. Then, during each subsequent 'differential' backup (where only those files which have changed since the last backup), each backup set is merged with the full backup set.

A synthetic backup is a compromise between the two methods mentioned. Here, a full backup is maintained. Daily incremental backups are performed and spread across multiple locations (tapes or folders) say, 5 or 10 days apart. Then, at the end of the 5, or 10 day cycle, these are merged to the full backup set and the process of incremental backups start again, replacing the previous incremental backup sets rather than appending them to the previous backup sets.


Please advise. And please be specific.

Please be advised though that your data is only as safe as the method you choose to back it up.
Integrated ntbackup.exe utility has all needed features except file mask filtering.
And its manual says:

Incremental backup. An incremental backup backs up only those files created or changed since the last normal or incremental backup. It marks files as having been backed up (in other words, the archive attribute is cleared). If you use a combination of normal and incremental backups, you will need to have the last normal backup set as well as all incremental backup sets in order to restore your data.

So, solution in t0t0's post (ID:24084044) is implementing exaclly incremental one (see description for XCOPY key /M).
So, setting up Archive attribute have sense before the first backup, and before each full backup in later times.
Try this one. It makes copies wit set archive flag in attributes and creates folder in destination with current date.
Save this to some *.cmd file and run.
In the first loop it iterates drives to backup (in sample C:, D:);
Second loop iterates needed filetypes.
set Dest=\\server\Backup

FOR %%b IN (c d) DO (
    FOR %%a IN (doc txt pdf pst) DO (
    @XCOPY "%%b:\*.%%a" "%Dest%\%DATE%\%%b" /M /H /R /Y /S /I
    )
)

Excellent
Thanks Experts. This same code as would be in Visual Studio?
Thnak you very gladly
REM to answer your question...
REM
PRINT what language in visual studio are you refering to?
INPUT response
IF response >= DOS 7 THEN
   PRINT yes!
END IF
t0t0, +1  :-)))

Any language in MS VS can call command processor in some way. So, any of them can use this script.
This same code as would be in Visual Studio 2005