AIX: Cannot Open or Remove a File Containing a Running Program



Share this article :
cp: /<test1>: Cannot open or remove a file containing a running program.
cp: /<test2>: Cannot open or remove a file containing a running program.
cp: /<test3>: Cannot open or remove a file containing a running program.

Method 1

1. Execute the slibclean command. This will removes unused kernel & library memory modules

# slibclean

Method 2

1. If you encountered this error while dealing with FTP session, you need to kill the related FTP session and restart the process again.

# ps -ef | grep ftpd
# kill -9 <Process-ID>

Additional note:
We need to kill the process that locked the file.

Method 3 (Dirty way)

1. In case, you encountered the error while copying the files over AIX. You can trick the system by move the file instead of copy. But, make sure to make a backup of the file before move.

# cp /<test> <test>.bak
# mv /<test> /<other_directory>

Related posts

Lock & Unlock User in AIX
Set Leave Reminder in AIX
slibclean: Removes AIX Unused Kernel & Library Memory Modules
errpt: Generates a Report of Logged Errors
© 2017 ITsiti. All Rights Reserved
Powered by KEEM