Need Help: Delete a file by Shell Script

Need some help here.

We FTP out files to another server hourly. But before we can FTP to the other server. That server should send our server a "confirmation file" to tell us that they're ready to receive data. If they don't send the confirmation file, the files on our server should just stay until the next confirmation file. After sending the files to the other server, our script is supposed to delete the "confirmation file".

A script (with .scr filename) runs a shell script (with .sh filename). The shell script is the one which is supposed to delete the "confirmation file" after FTPing the files to the other server. Our problem right now is that the file that's supposed to be FTPed to the server is successfully FTPed BUT the "confirmation file" does not get deleted in the directory.

Any ideas on why a file does not get deleted by a shell script?

Post that part of the script which is supposed to do the deleting.

Are you using mdelete or delete to delete the file on the remote machine ?

Also, you might not have the delete permissions on that remote machine. A write permission does not mean you have delete permission as well.

Vino

how do i know if the user of the script has delete permission and not just write permission?

Here's the part of the script which should have deleted it?
rm root directory/directory/file

You cant just rm a remote file on an ftp server. You need to use the delete command.

I am not sure, how you can set the delete permissions (via command line) for a user.

I use Cerberus FTP Server, and since it has an UI, I can set the required permissions for different user.

Vino

What if the file that needs to be deleted is in the same server as the script? I still can't use rm ?

It's actually an EDI Gentran UNIX server.

Once you are inside an ftp session, issue help

That will show you the commands that you can give at the ftp prompt.

Again, if you are inside an ftp session, then you could try this to remove a local file

ftp> !rm sample.txt

That should remove the sample.txt on your local machine

Vino