Link to home
Start Free TrialLog in
Avatar of jjafferr
jjafferrFlag for Oman

asked on

Daily Backup

Hi Experts

I have a network of PCs, and would like to make a bat file that will:
copy (backup) the updated files from a specific directory (say outlook)

these files should be copied to a network drive which is password protected (say \\jaffer\f),
under \\jaffer\f
I want to make directories based on the date the backup is done (say 16),
under \\jaffer\f\16
I want to make directories based on the user name (say Adolf),
so the directories should look like this:
\\jaffer\f\16\Adolf
\\jaffer\f\16\Jaffer
\\jaffer\f\17\Adolf
\\jaffer\f\17\Jaffer

The dates are 1 to 31 (our date format is dd-mm-yy).
So the code should look at the current date then copy (Xcopy or Replace) the Outlook folder to the right folder in the network drive.

http://www.chebucto.ns.ca/~ak621/DOS/Bat-Adv.html#CDUL
and
http://www.chebucto.ns.ca/~ak621/DOS/Bat-Adv.html#UPDATE
look short and interesting, but I leave it to you guys.

It will be best if the password could be encrypted.

Any help is appreciated,

jaffer
Avatar of Filips Houbrechts
Filips Houbrechts
Flag of Belgium image

I know this is not the answer for your question but ... do you realy have to do this in DOS? That's totally unreliable. Is there a specific reason to use DOS?
Avatar of cwwkie
cwwkie

you should use robocopy I think;


@echo off
for /f "tokens=1,2,3,4 delims=- " %%a in ('date /t') do set dd=%%b
net use \\jaffer /user username password

net use \\adolf /user username password
md \\jaffer\f\%dd%\adolf
robocopy \\adolf\outlook \\jaffer\f\%dd%\adolf /mir
net use \\adolf /d

net use \\jaffer /d


robocopy:
http://www.ss64.com/nt/robocopy.html
http://go.microsoft.com/fwlink/?LinkId=4544
Avatar of jjafferr

ASKER

Hi Filips
Why Dos?
I used to do the following, which worked ok:
- Made the Outlook Directory shared (no password) on every PC (this made everybody see everybody else's contents),
from the main PC, I used Cobian backup, which copied everything OK.

Now I want to do it the other way around, that is to send the data from the each PC to a shared directory in the main PC, and use  schedual task for this.

I can do this with MS Access (I am a Sage https://www.experts-exchange.com/M_934166.html), where I can make a task schedual run an Access mdb, then Iam in total command.

I just thought a bat file using schedual task would be easier!

So do you guys recommend me go my way?

cwwkie, I will await your comment to my post before I try your suggestion.

thanks,

jaffer
SOLUTION
Avatar of cwwkie
cwwkie

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
> makes everybody see everybody else's contents on the backup server
The backup server shared directory is password protected, so I am covered.

> The disadvantage is that you must make sure that all tasks are executed on all pc's
I agree, and I can see your point here, which I didn't think off (we have an ISO audit soon which is driving me crazy).

> client pc's with a password
Cobian Backup (http://www.educ.umu.se/~cobian/cobianbackup.htm) cannot use password to fitch data, but I can certainly write my own code with MS Access to do this.

> Which version of windows are you using?
WinME and WinXP Pro.

I better sleep on it then decide which direction I should take.

thanks for making think out loud :o)

jaffer
> > client pc's with a password
> Cobian Backup (http://www.educ.umu.se/~cobian/cobianbackup.htm) cannot use password
> to fitch data, but I can certainly write my own code with MS Access to do this.

I don't know much about access, but you can make the password protected network connection first in a batchfile, then run cobain backup, and remove the network connection afterwards.
ASKER CERTIFIED SOLUTION
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
Thanks guys for forcing me to rethink, I decided to do it in Acces VBA, and if I don't forget, I will post what I did.
I will use the task schedual to run my Access mdb, which will take care of all those stuff through VBA.

jaffer
Thanks for the A. I hope you succeed amd all runs well.