Solved

pc support in the server extensions *.doc

Posted on 2009-04-06
23
210 Views
Last Modified: 2013-11-26
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
0
Comment
Question by:VicManuel
  • 10
  • 7
  • 6
23 Comments
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24082810
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.
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24082826
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:\
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24084044
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.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24084054
Oh, that should be:...

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

etc...
 
0
 

Author Comment

by:VicManuel
ID: 24087836
Hey thanks. You can support. Docx? one more thing .. I need to be incremental
0
 

Author Comment

by:VicManuel
ID: 24087887
Hi I would be most useful in Visual Studio incremental and the following extensions. Doc, docx,. Pst thanks
0
 
LVL 16

Accepted Solution

by:
t0t0 earned 500 total points
ID: 24087911
You can add DOCX as follows:

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

Expert Comment

by:Mechanic_Kharkov
ID: 24088111
What do You mean "incremental"? Create each time new folder in destination with incremental name?
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24088137
Mechanic_Kharkov

I'm in the process of replying to VicManuel regarding this issue....
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24088174
t0t0

Also interested to know how to create folder names in batch loop. Waiting for Your solution. Thanks.
0
 

Author Comment

by:VicManuel
ID: 24088298
Incremental backup is the next look to use the backup are kept only the files that were modified
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 16

Expert Comment

by:t0t0
ID: 24088324
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.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24088343
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.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24088703
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.


0
 
LVL 16

Expert Comment

by:t0t0
ID: 24088739
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.
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24088787
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.
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24089712
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
    )
)

0
 

Author Closing Comment

by:VicManuel
ID: 31567270
Excellent
0
 

Author Comment

by:VicManuel
ID: 24090100
Thanks Experts. This same code as would be in Visual Studio?
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24090198
Thnak you very gladly
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24090246
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
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24090295
t0t0, +1  :-)))

Any language in MS VS can call command processor in some way. So, any of them can use this script.
0
 

Author Comment

by:VicManuel
ID: 24091263
This same code as would be in Visual Studio 2005
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now