Discussion:
How to make fewer backups or eliminate duplicates?
(too old to reply)
mm
2011-02-12 00:46:47 UTC
Permalink
So now that I think I have the program running that backs up my file
every 5 minutes, I'd like to either get fewer backups or delete the
duplicate ones.

To get fewer backups, I thought maybe I could check before backing up
if the attribute byte had changed. But Copy doesn't have that
facility, and when I had used XCopy, it kept asking me if the
destination was a file or a directory. There seem to be ways to make
it assume it's a directory, but I can't figure out how to make it
assume it's a file.

The destination files don't have the same name as the source file, and
I don't want to have to manually answer this question every 5 minutes.


To delete the duplicate files, I thought rather than write my own, I
would find a dos or windows program to go through the directory
looking for consecutive files of the same length. Not a dos question
probably, but I thought I'd mention it in case you know something like
that!

Thanks.
Sjouke Burry
2011-02-12 01:52:54 UTC
Permalink
Post by mm
So now that I think I have the program running that backs up my file
every 5 minutes, I'd like to either get fewer backups or delete the
duplicate ones.
To get fewer backups, I thought maybe I could check before backing up
if the attribute byte had changed. But Copy doesn't have that
facility, and when I had used XCopy, it kept asking me if the
destination was a file or a directory. There seem to be ways to make
it assume it's a directory, but I can't figure out how to make it
assume it's a file.
The destination files don't have the same name as the source file, and
I don't want to have to manually answer this question every 5 minutes.
To delete the duplicate files, I thought rather than write my own, I
would find a dos or windows program to go through the directory
looking for consecutive files of the same length. Not a dos question
probably, but I thought I'd mention it in case you know something like
that!
Thanks.
Add a slash after the directory name.
exacmple: to xcopy the directory c:\data\2001 to drive h:\backup\2001 :
xcopy c:\data\2001\ h:\backup\2001\
mm
2011-02-12 12:18:40 UTC
Permalink
On Sat, 12 Feb 2011 02:52:54 +0100, Sjouke Burry
Post by Sjouke Burry
Post by mm
So now that I think I have the program running that backs up my file
every 5 minutes, I'd like to either get fewer backups or delete the
duplicate ones.
To get fewer backups, I thought maybe I could check before backing up
if the attribute byte had changed. But Copy doesn't have that
facility, and when I had used XCopy, it kept asking me if the
destination was a file or a directory. There seem to be ways to make
it assume it's a directory, but I can't figure out how to make it
assume it's a file.
The destination files don't have the same name as the source file, and
I don't want to have to manually answer this question every 5 minutes.
To delete the duplicate files, I thought rather than write my own, I
would find a dos or windows program to go through the directory
looking for consecutive files of the same length. Not a dos question
probably, but I thought I'd mention it in case you know something like
that!
Thanks.
Add a slash after the directory name.
xcopy c:\data\2001\ h:\backup\2001\
Won't that make xcopy assume H:\backup\2001\ is a directory?**

I want it to assume the destination is a file, though one with a
different name from the source.

**Yes, I tested it and it does. It creates directories with the names
I wanted for the files, and creates a file within each directory with
the same name all the time, the name of the source file.

Maybe now I know why I've seen long strings of directories that I
didn't create, each with one or two files in it. Maybe, because it's
easier to create a directory with a different name than a file with a
different name.


Billious's post is longer and will take more time to answer.
mm
2011-02-12 13:20:29 UTC
Permalink
Post by mm
On Sat, 12 Feb 2011 02:52:54 +0100, Sjouke Burry
Post by Sjouke Burry
Post by mm
So now that I think I have the program running that backs up my file
every 5 minutes, I'd like to either get fewer backups or delete the
duplicate ones.
To get fewer backups, I thought maybe I could check before backing up
if the attribute byte had changed. But Copy doesn't have that
facility, and when I had used XCopy, it kept asking me if the
destination was a file or a directory. There seem to be ways to make
it assume it's a directory, but I can't figure out how to make it
assume it's a file.
The destination files don't have the same name as the source file, and
I don't want to have to manually answer this question every 5 minutes.
To delete the duplicate files, I thought rather than write my own, I
would find a dos or windows program to go through the directory
looking for consecutive files of the same length. Not a dos question
probably, but I thought I'd mention it in case you know something like
that!
Thanks.
Add a slash after the directory name.
xcopy c:\data\2001\ h:\backup\2001\
Won't that make xcopy assume H:\backup\2001\ is a directory?**
I want it to assume the destination is a file, though one with a
different name from the source.
I got around this just now by letting it leave the name unchanged
during the copy, and then renaming the file in the next step.

So now I can use Xcopy and the /m switch. That will eliminate
duplicate copies, which are the only unwanted copies.

Thanks all of you for the help.
Post by mm
**Yes, I tested it and it does. It creates directories with the names
I wanted for the files, and creates a file within each directory with
the same name all the time, the name of the source file.
Maybe now I know why I've seen long strings of directories that I
didn't create, each with one or two files in it. Maybe, because it's
easier to create a directory with a different name than a file with a
different name.
Billious's post is longer and will take more time to answer.
Loading...