LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-09-2009, 07:24 AM   #1
laode
LQ Newbie
 
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Rep: Reputation: 0
cannot create regular file ...: text file busy


Hi,

I compield a new bash into /usr/local/bin and want to copy now to /bin, but get above error-message.

I changed default shell to ksh, reboot, checked for any bash-porcess, but nothing to see with ps -ef | grep bash.

As soon, as I try to copy bash, I get above error-message. Why ?

what is meaning of that message ?

how can I overcome that blocking ?

thanks for any tip, laode
 
Old 06-09-2009, 07:36 AM   #2
laode
LQ Newbie
 
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Original Poster
Rep: Reputation: 0
cannot create regular file....solved

Hi

Problem solved, I wasn't aware that root was using bash as well, when loged in by 'su -'.

thanks anyway, laode
 
Old 11-26-2012, 09:56 AM   #3
MicBert
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Rep: Reputation: 0
Overwrite busy files

When a file is opened and locked by a process, any other process is not allowed to write into it, and in particular to completely overwrite it. But anyone (with the necessary rights) can rename it.
Thus the procedure I usually follow in this case is:
  1. rename the old file
  2. copy the new file, with the old name of the existing one
  3. once the file is unlocked, I delete it
Note that after the step 2, the locking process still operates on the renamed file, but any new process will refers to the new one!

Michele
 
Old 11-26-2012, 11:05 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by MicBert View Post
[*]once the file is unlocked, I delete it
No need to wait. You can remove the file right away. The kernel will keep the old file around on disk until no one is using it.
 
Old 11-27-2012, 01:56 AM   #5
MicBert
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Rep: Reputation: 0
It's true, I have just tried. Thanks!

I remembered it is not possible under windows, so I never tried neither under linux.

Michele
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp text file busy error seran Linux - General 4 08-12-2021 03:36 PM
text match pipe to file then delete from original text file create new dir automatic tr1px Linux - Newbie 6 09-10-2008 09:40 PM
Text file Busy yusufs Linux - Newbie 7 01-05-2008 06:12 AM
cp: cannot create regular file Raakh Linux - Newbie 1 07-17-2007 10:00 AM
/etc/rc.sysinit: /bin/awk: Text file busy teeno Linux - Software 5 02-23-2005 02:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration