LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-05-2005, 03:57 PM   #1
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
mv: how to protect files from being moved


Hey

I have to write a little script which automatically moves files to a different directory if they have not been modified recently.

However, there are about 10 files/directories which will never be modified, but I don't want to move them, ever.

Therefore, my question is: how can I move all my files automatically, but protect these 10 files/directories?

Is there any kind of "exclude-from" list for mv?

Thanks
Hamish
 
Old 09-05-2005, 04:03 PM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
You could make them read-only.
 
Old 09-05-2005, 04:17 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You could use find to check the modified time and exclude the names using the same find command or just touch the directories first.
 
Old 09-05-2005, 04:39 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Or you could mark them (the directories, not the files) as "sticky." See man chmod for details.
 
Old 09-05-2005, 09:15 PM   #5
shengchieh
Member
 
Registered: Jul 2004
Location: Palo Alto, CA
Distribution: #! Korora
Posts: 472

Rep: Reputation: 30
Or you could change ownership of these files
using chown.

Sheng-Chieh
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to protect files from people with su ability cotton213 Linux - Security 5 12-10-2004 08:56 PM
How do I password protect folders/files? shodekiagari Linux - Software 6 12-04-2004 12:16 PM
password protect zip files xlord Linux - Newbie 3 05-04-2004 12:04 PM
Files still appear after moved to trash~ xhunter Linux - General 3 10-11-2003 09:33 AM
Moved log files magyartoth Linux - General 1 06-04-2002 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:17 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