Jump to content

Recommended Posts

Posted

My wife runs a small language school and we have 6 networked PCs for the students

 

Each day I run a series of batch files to create backups of files etc - and for the most part they all work fine.

 

However, one of the backup areas is on a USB flash drive connected to my router and this makes available a few things on the network for anyone no matter which computer is switched on or being used at the time. It also saves my hard disks from having to run all the time just to make these files available.

 

The batch file code to do this part of the backup is very simple and designed to only copy new or any updated files - nothing else should be copied

 

xcopy "C:\backup\english" "\\DSL-N55U-0014\english" /s /d /y

pause

 

The problem is that each time I run it, the files in just a -couple of the many sub folders insist on copying again every time despite none of the files having been updated. This does not happen when I am copying the same folders to other HDDs. I have tried adding the /a switch but it still happens - obviously there is something causing this but what? - any help appreciated.

 

In reality its not much of an issue as the files copy pretty fast - but why? - non of the many hundreds of others don't!

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • ExTS Admin
Posted

Hi joddle,

 

I'm a bit rusty on batch files, but that code does seem ok to me.

The /d command should only copy any newer source files..... so I'm not sure why it only happens with some files.

There's no date command added so nothing to confuse the issue.

 

Not that it will make any difference to the backup, but any reason you added the 'pause'? ( you could save having to hit any key to continue )

Member of:

UNITE

Posted
Hi joddle,

 

I'm a bit rusty on batch files, but that code does seem ok to me.

The /d command should only copy any newer source files..... so I'm not sure why it only happens with some files.

There's no date command added so nothing to confuse the issue.

 

Not that it will make any difference to the backup, but any reason you added the 'pause'? ( you could save having to hit any key to continue )

 

Thanks for you reply - I am no expert on batch files - or at least pretty rusty and although I know robocopy may help I cant be bothered to learn a new set of instructions when in theory the ones I am using should work fine.. In fact they do when the same code writes to a HDD! - its only when it writes to the flash drive that the issues happen - I am suspecting its something to do with the attributes but can't see why some files are affected and some not - most of them are dated before 2013 so should not be getting copied at all! There has to be an explanation but for now it eludes me.

 

PS the pause is only there so the screen does not go off before I have seen that the programme has worked through - the lines I supplied are only the offending ones from a large batch file with many more xcopy statements (all which work fine!) and some even are clones of the lines I illustrated but going to an hdd!

  • ExTS Admin
Posted

Hi joddle,

 

I've had one of my colleagues take a look at this thread and he agrees that the batch file you are using is correct for the job you want it to do.

Which leaves us with a possible problem between the HDD and the USB stick.

He did point out one possibility.... your HDD will be formatted to NTFS, but the Usb stick will be formatted to Fat32 ( unless you have reformatted the Usb stick)

As the 2 types of format are different, it maybe the cause of the error. ( it's hard to say for sure)

 

If you have a spare Usb stick, you could try re-formatting this to NTFS and see if the problem still occurs.

 

If you do decide to try that, there is something that I have to point out.....

Fat32 doesn't need File permissions... unlike NTFS.

So where a Usb stick can normally be used in any device, formatting it to NTFS may mean that this Usb stick could then only be used in the one device.

Normally there’s really no reason to use NTFS on USB sticks and SD cards — unless you need support for files over 4GB in size.

 

Entirely up to you if you want to try this, if you do this link will explain how to reformat the Usb stick:

format a USB Flash Drive to NTFS file system

Member of:

UNITE

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...