Debian: rsync and cp is corrupting contents of CSV files

1

1

I have a weird problem. I wrote a script that scans a directory on a samba share (a OpenSUSE server on the LAN) and uses cp to copy certain CSV files to the local Debian server web root at /var/www.

The script works absolutely fine if it encounters one file to copy, but if there are several, weird things happen.

The files get copied to the destination folder but end up heavily corrupted. It looks as though Debian is somehow mixing up the files to create a sort of hybrid.

A simple example

If in the source directory there are the files A.csv and B.csv, containing just a few rows, such as:

A.csv:

"123","Joe Bloggs","Birmingham","UK"
"456","Ann Other","London","UK"

B.csv:

"BBB","Mr Smith","Liverpool","UK"
"CCC","Mrs Jones","Cardiff","UK"

In the destination folder I have seen completely mingled content such as:

A.csv:

"BBB","Mr Smith","Liverpool","UK"
"123","Joe Bloggs","Birmingham","UK"

B.csv:

"123","Joe Bloggs","Birmingham","UK"
"456","Ann Other","London","UK"
"BBB","Mr Smith","Liverpool","UK"

And any other weird combinations you can imagine, including unknown character set characters, shortened lines (missing fields), missing delimiters, you name it.

I have received the same results regardless of if I use cp or rsync...and have Google for hours for a solution.

What gives? Can someone shed some light on this weird problem?

George

Posted 2011-06-29T12:36:49.000

Reputation: 163

1It sounds like either the windows filesystem or samba has it's wires seriously crossed, but I really don't know what to make of that. – Caleb – 2011-06-29T12:44:40.233

Do a memory test on both machines involved.

– Gilles 'SO- stop being evil' – 2011-06-29T20:15:09.863

Answers

0

I fixed it. I think Caleb was right that the smbfs mount point had become seriously corrupted or broken... a reboot of the Debian box solved it as this would have remounted the smb share.

There goes my uptime of over 40 days...

George

Posted 2011-06-29T12:36:49.000

Reputation: 163