File with no permissions

All,

I have a very strange situation here. I have a server with 2 filesystems for 2 different users.

The filesystem my user id is part of is copying a file with permissions 666 to the other filesystem - the files copied are owned by my userid.

Sometimes, the file will be copied and when checked in the receiving end, the permissions is 000.

I will then have to manually grant the permissions again as the other user id does not have the priviledge.

How can this happen? Any advise on how to script a solution to this?

Would appreciate any input/thoughts....I am really dumbfounded..:o

It does sound strange. Can you give us more specifics of your :

  • your OS
  • how you were doing the copying (exact command)
  • the underlying filesystems
  • a sampling of filenames that exhibit the problem

OS: HPUX 11
Copying was done by mv command
Filesystem 1: myusrid:/vg01/vgroup/folder/file
Filesystem 2: hisusrid:/vg02/vgroup/usr/inbdfile/work

Note: there is a process in the 2nd filesystem that picks up the file in work and places in another /proc folder.

No specific filename is exhibiting this, it happens randomly.

Hope this helps!!!

Where are you seeing 000? Filesystem 2: hisusrid:/vg02/vgroup/usr/inbdfile/work or /proc?
mv preserves permissions - are you sure that the source permissions were 666 for the problem files?

I believe that answers rikxik's question.

What uid owns the move process? root, I hope?

How about trying to reproduce the problem in controlled circumstances: Create 1000 files and try moving them from one directory to another -- first, on the same filesystem/same user id, then on the same filesystem/different userid, then on different filesystem, etc.

If you need to create 1000 files, do something like:

let x=0
while [ $x -lt 1000 ]; do
  touch f.$x
  let x=x+1
done

It could be the mv hasnt finished yet...
e.g.:

ant:/tsmx/storage $ id
uid=6206(jju) gid=20(users)
ant:/tsmx/storage $ cp VBMAX.G0006V00 toto&
[1]     12047
ant:/tsmx/storage $ ll
total 4555104
drwxr-xr-x   3 root       sys           6144 May 20  2008 080520
-rw-rw-r--   1 vbe        bin        2296334520 Jun 26  2008 VBMAX.G0006V00
-rwxrwxrwx   1 vbe        bin        12066955 Nov 13 19:47 c3201231_tsmadminref4aix.pdf
drwxr-xr-x   2 root       root            96 Dec  5  2007 lost+found
drwxrwxrwx   2 vbe        bin             96 Feb  6 17:02 more_storage
drwxrwxrwx   2 vbe        bin           2048 Jun 19  2008 tar_gz_files
----------   1 jju        users      23724032 Mar  5 10:56 toto
drwxr-xr-x   2 vbe        bin             96 Jan  8  2008 vbe

Just thoughts...
Once finished:

-rw-r--r--   1 jju        users      2296334520 Mar  5 10:57 toto

Look the timestamp of the 2 toto files...

Thanks for your comments. But is it possible the mv did not finish? Hung?

I am using mv -f in the script to copy the file
Then apply a chmod 666 to ensure the permissions

Still some random files are with perm 000....

Possible that another copy process could mess up the perm?...sorry I am really at a wit's end with this.

You have the size you can compare...
Could it be at that instant you have no more space (but I dont think it ends with no priv written and have no time to test...)
I will think a little and come back later...

test:
session1

ant:/tsmx/storage $ cp VBMAX.G0006V00 toto
Terminated
ant:/tsmx/storage $ ll
total 5427172
drwxr-xr-x   3 root       sys           6144 May 20  2008 080520
-rw-rw-r--   1 vbe        bin        2296334520 Jun 26  2008 VBMAX.G0006V00
-rwxrwxrwx   1 vbe        bin        12066955 Nov 13 19:47 c3201231_tsmadminref4aix.pdf
drwxr-xr-x   2 root       root            96 Dec  5  2007 lost+found
drwxrwxrwx   2 vbe        bin             96 Feb  6 17:02 more_storage
drwxrwxrwx   2 vbe        bin           2048 Jun 19  2008 tar_gz_files
-rw-r--r--   1 root       sys            123 Mar  5 19:56 titi
----------   1 vbe        bin        470286336 Mar  6 11:37 toto
.
.

session2:

ant:/home/vbe/script $ ps -ef|grep "cp " 
    root 11514 28611  1 11:36:51 pts/10    0:00 grep cp 
     vbe 11511 13863 136 11:36:47 pts/26    0:01 cp VBMAX.G0006V00 toto
ant:/home/vbe/script $ kill 11511

Conclusion:
If something interfers with the cp (or mv...) you stay with a file in no perms state...
Again the size will say more (complete or not...)