Help with permissions

i am trying to write a simple script to move files from one folder to another and when i try to run the script i get permission errors. I am still new to all of this and permissions still confuse me. Can anyone shed some light?

I have attached screenshots of my script in the middle. (which i have taken from another to use for this)
At the top is the output and at the bottom is the file i want moved. If there is any other info i can get let me know.

thanks.

Hi, can you post the output of:

ls -ld /ftp /ftp/Archive
id

Hi,

This looks like a very AIX-specific IBM-style error message that's more detailed than what I've ever seen mv give for a simple file permissions issue on Solaris or Linux, but I'm inclined to believe that it means what it says it does. Either you don't have permission to copy the file into the destination directory, or you don't have permission to remove it from the source directory.

So unless it's some error message specific to role-based access control on AIX or something equally unique (in which case someone familiar with the intricacies of AIX can hopefully help, as I'm not really experienced with it at all) I'd start with checking that.

One easy test: if you try doing this exact mv command manually at the shell prompt, does it work ? If not, can you copy the file into the destination directory ? And if you can copy it, can you remove the original ? Doing this kind of basic step-by-step debugging should hopefully reveal where the problem lies.

This is refusing one of three things:-

  • You can't write to the source directory (cannot unlink the old reference)
  • You can't write to the target directory (cannot link the new reference)
  • You can't read the source file (read to copy if moving filesystem)

In addition to the output requested by Scrutinizer, can you list the file you want to move with ls -ld lynx*test*

It might also be worth dropping the trailing /. from the target directory on the move, so it becomes mv lynx*test* $clftparchive only.
It would be wise to check that this directory exists before trying to write to it with:-

if [ -d $clftparchive ]
then
   # do the move
else
   # throw an error alert
fi

I'm sure we can help you work this out,
Robin