Solved

Copy Command is Deleting Files

Posted on 2013-01-07
8
361 Views
Last Modified: 2013-01-08
I am performing a SQL backup and copy between servers using bat files and Task Scheduler.
I create the backup files, then copy them from one server to another.  The copy command copies all existing files; I use clear commands to remove older files.
The backup is working properly, but the copy command is deleting existing files selectively on the receiving server.  For example, a file from1/1/2013 is there on 1/2, but missing on 1/7. Other files from the same day remain.
I have disabled the clear commands, so how is the copy command deleting files?
Backup-a.xlsx
0
Comment
Question by:fhcdaver
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 500 total points
ID: 38752649
And no human has access to the place where the files are being copied?  No other process deletes files from there?  

I'd turn on auditing and see who's doing what.
0
 

Author Comment

by:fhcdaver
ID: 38752793
I'm confident no person is doing it, and don't see any other processes.  

Is it possible that intermittent transmission errors in the midst of the copy/overwrite of existing files are deleting existing files without successfully replacing them?
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 38753281
When the batch file runs that does the copy, does it ever report any errors from the copy command?  If not I'd be surprised if it was deleting the files.

You might want to add a DIR of the destination folder at the start and end of the BAT file to try and see if the files go missing as a result of it running.

~bp
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 38754687
"Is it possible that intermittent transmission errors in the midst of the copy/overwrite of existing files are deleting existing files without successfully replacing them?"
I don't see how.  Moreover, if you're sure the files exist at some point, then are deleted, I fail to see how the copy command could be responsible for that.  

Is there a separate clean-up process?  Are you unwilling or unable to audit file access/permission use to see when these files are being deleted?
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 38754715
What are the names of these files, naming rules--is it possible old and new files have the same names and so when copied replace an existing?
0
 

Author Closing Comment

by:fhcdaver
ID: 38755201
I will try the auditing.
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 38755386
So, just curious, what was the source of the disappearing files, and how did you resolve it?

~bp
0
 

Author Comment

by:fhcdaver
ID: 38756904
I have not figured out the problem, so we are going to monitor the situation and see what happens.  if we discover the cause, I will post it.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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