I am attempting to move a file from one directory to another on a CIFS mounted file system using the command:
mv /mnt/development/Backup/NagiosServer/latest/* /mnt/development/Backup/NagiosServer/daily/
This produces the error message:
mv: '/mnt/development/Backup/NagiosServer/latest/20190512-backup.zip' and '/mnt/development/Backup/NagiosServer/daily/20190512-backup.zip' are the same file
The target file in the .../daily/ directory definitely does not exist at this point.
This is the listing of the relevant directories after the error occurs:
nagios@nagios-server:~$ mv /mnt/development/Backup/NagiosServer/latest/* /mnt/development/Backup/NagiosServer/daily
mv: '/mnt/development/Backup/NagiosServer/latest/20190514-backup.zip' and '/mnt/development/Backup/NagiosServer/daily/20190514-backup.zip' are the same file
nagios@nagios-server:~$ ls -lsha /mnt/development/Backup/NagiosServer/latest/
total 3.5G
0 drwxr-xr-x 2 nagios root 0 May 15 08:00 .
0 drwxr-xr-x 2 nagios root 0 May 13 15:15 ..
3.5G -rwxr-xr-x 1 nagios root 3.5G May 14 17:13 20190514-backup.zip
nagios@nagios-server:~$ ls -lsha /mnt/development/Backup/NagiosServer/daily
total 18G
4.0K drwxr-xr-x 2 nagios root 4.0K May 15 08:00 .
0 drwxr-xr-x 2 nagios root 0 May 13 15:15 ..
3.5G -rwxr-xr-x 1 nagios root 3.5G May 8 17:12 20190508-backup.zip
3.5G -rwxr-xr-x 1 nagios root 3.5G May 9 17:12 20190509-backup.zip
3.5G -rwxr-xr-x 1 nagios root 3.5G May 10 17:12 20190510-backup.zip
3.5G -rwxr-xr-x 1 nagios root 3.5G May 11 17:14 20190511-backup.zip
3.5G -rwxr-xr-x 1 nagios root 3.5G May 12 17:12 20190512-backup.zip
The listing of the unmounted mount point shows nothing:
nagios@nagios-server:~$ ls /mnt/development/
nagios@nagios-server:~$
I followed the advice found here to disable CIFS caching, which works, but only the first time the mv is attempted. Thereafter it fails with the same error message.
What is going on here?
I am running under Ubuntu 18.04 and the mounted CIFS file system is on a remote Windows 10 machine. Also, The Windows machine is running a VirtualBox VM that also runs Ubuntu 18.04. The mv command works without issue when run from the VM.