#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Back Up

Greetings !

If, while using Windows Explorer,
I drag a folder from one disk to another,
the files in the dragged folder
and its sub-folders are written
to the target disk - regardless.

This means that
(a) newer files may be over-written by older files, and
(b) EVERY file is copied - which can take HOURS.


Challenge 1
I want to do selective backups,
copying from the "main" disk to
a backup disk ONLY those files
more recent than a defined date
(that of the last backup).

Challenge 2
I want to do a different form of
selective backup, copying from
the "main" disk to a backup disk
ONLY those files that either do
not exist on the backup disk,
or are more recent than the version
stored on the backup disk.


My current attempts are based
upon shelling out to DOS to run

dir /s Source.lst
dir /s Target.lst

to generate text files for the two disks.

The Target list is then read in
line-by-line and stored in a worksheet
with one file record on each line,
bearing in adjacent columns
the Drive letter, the path, the filename,
the date and the size.

I then read in the other file line-by-line
and compare this entry with the
tabulated entries. When a match is found,
action is directed into a batch file
that is run upon completion.

"There must be a better way" !

Any ideas would be most welcome !


RClay AT haswell DOT com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Back Up

Robin,

Are you interested only in Excel Files, or any file within the folder and
its sub-folders?

HTH,
Bernie
MS Excel MVP

"Robin Clay" wrote in message
...
Greetings !

If, while using Windows Explorer,
I drag a folder from one disk to another,
the files in the dragged folder
and its sub-folders are written
to the target disk - regardless.

This means that
(a) newer files may be over-written by older files, and
(b) EVERY file is copied - which can take HOURS.


Challenge 1
I want to do selective backups,
copying from the "main" disk to
a backup disk ONLY those files
more recent than a defined date
(that of the last backup).

Challenge 2
I want to do a different form of
selective backup, copying from
the "main" disk to a backup disk
ONLY those files that either do
not exist on the backup disk,
or are more recent than the version
stored on the backup disk.


My current attempts are based
upon shelling out to DOS to run

dir /s Source.lst
dir /s Target.lst

to generate text files for the two disks.

The Target list is then read in
line-by-line and stored in a worksheet
with one file record on each line,
bearing in adjacent columns
the Drive letter, the path, the filename,
the date and the size.

I then read in the other file line-by-line
and compare this entry with the
tabulated entries. When a match is found,
action is directed into a batch file
that is run upon completion.

"There must be a better way" !

Any ideas would be most welcome !


RClay AT haswell DOT com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Back Up

Yup - the FileSystemObject. Check out the Excel help for it. You can go
through each file in your drive/folder recursively and check the modified
date, copying it to the new location if it fits your criteria - that'll sort
option 1. You can also check to see if each file exists by looking for the
equivalent file on the target directory and copying the file if you get an
error message (ie the file doesn't exist). Add a reference to Microsoft
Scripting Runtime and declare a new FileSystemObject; that way you can see
all the properties and methods it supports - it's very versatile.

Jeff

"Robin Clay" wrote in message
...
Greetings !

If, while using Windows Explorer,
I drag a folder from one disk to another,
the files in the dragged folder
and its sub-folders are written
to the target disk - regardless.

This means that
(a) newer files may be over-written by older files, and
(b) EVERY file is copied - which can take HOURS.


Challenge 1
I want to do selective backups,
copying from the "main" disk to
a backup disk ONLY those files
more recent than a defined date
(that of the last backup).

Challenge 2
I want to do a different form of
selective backup, copying from
the "main" disk to a backup disk
ONLY those files that either do
not exist on the backup disk,
or are more recent than the version
stored on the backup disk.


My current attempts are based
upon shelling out to DOS to run

dir /s Source.lst
dir /s Target.lst

to generate text files for the two disks.

The Target list is then read in
line-by-line and stored in a worksheet
with one file record on each line,
bearing in adjacent columns
the Drive letter, the path, the filename,
the date and the size.

I then read in the other file line-by-line
and compare this entry with the
tabulated entries. When a match is found,
action is directed into a batch file
that is run upon completion.

"There must be a better way" !

Any ideas would be most welcome !


RClay AT haswell DOT com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Back Up


Everything !

Thanks for responding.

-----Original Message-----
Are you interested only in Excel Files, or any file

within the folder and
its sub-folders?

HTH,
Bernie
MS Excel MVP



RClay AT haswell DOT com



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Back Up


Humphhhhh

This is the FOURTH time I have tried to reply to this !


-----Original Message-----
Yup - the FileSystemObject.
Check out the Excel help for it.


I did that - but hardly understood a word....
I am but a humble engineer.

You can go
through each file in your drive/folder
recursively and check the modified
date, copying it to the new location
if it fits your criteria - that'll sort
option 1. You can also check to see if
each file exists by looking for the
equivalent file on the target directory
and copying the file if you get an
error message (ie the file doesn't exist).


That sounds as if it's exactly what I want to achieve.

Add a reference to Microsoft
Scripting Runtime and declare a
new FileSystemObject; that way you can see
all the properties and methods it supports
- it's very versatile.


I wish I was ! I don't understand that bit at all :(

Thank you for responding - I guess I'm in for (yet
another) steep learning curve :(


RClay AT haswell DOT com



Robin Clay wrote


Greetings !

If, while using Windows Explorer,
I drag a folder from one disk to another,
the files in the dragged folder
and its sub-folders are written
to the target disk - regardless.

This means that
(a) newer files may be over-written by older files, and
(b) EVERY file is copied - which can take HOURS.


Challenge 1
I want to do selective backups,
copying from the "main" disk to
a backup disk ONLY those files
more recent than a defined date
(that of the last backup).

Challenge 2
I want to do a different form of
selective backup, copying from
the "main" disk to a backup disk
ONLY those files that either do
not exist on the backup disk,
or are more recent than the version
stored on the backup disk.


My current attempts are based
upon shelling out to DOS to run

dir /s Source.lst
dir /s Target.lst

to generate text files for the two disks.

The Target list is then read in
line-by-line and stored in a worksheet
with one file record on each line,
bearing in adjacent columns
the Drive letter, the path, the filename,
the date and the size.

I then read in the other file line-by-line
and compare this entry with the
tabulated entries. When a match is found,
action is directed into a batch file
that is run upon completion.

"There must be a better way" !

Any ideas would be most welcome !



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
back ups barry Excel Discussion (Misc queries) 2 February 1st 09 07:36 PM
Tab - Back Tab Question Jenny B. Excel Discussion (Misc queries) 2 January 7th 08 02:51 AM
copy back macro/roll back moh Excel Worksheet Functions 4 March 5th 07 02:19 PM
I hid row 1 and can't get it back? Nyczoo Excel Discussion (Misc queries) 4 January 24th 06 07:22 PM
Jon - come back Wazooli Charts and Charting in Excel 0 March 24th 05 04:49 PM


All times are GMT +1. The time now is 06:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"