LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-28-2006, 11:58 PM   #1
mikanoid
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Rep: Reputation: 0
cp problems with /proc


Recently installed slackware 11.0, using 2.6 kernel, which includes the /proc pseudo-filesystem. I use cp for simple backup to a removable drive, but cp hangs on /proc/kmsg. (It also takes a long time on /proc/kcore, hopefully it sees it as a sparse file.) Is there some way to make cp skip /proc (there's no documented option I can find)? I guess I could turn off /proc altogether but supposedly some programs in the distribution use it.
 
Old 10-29-2006, 04:20 AM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,442
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by mikanoid
Recently installed slackware 11.0, using 2.6 kernel, which includes the /proc pseudo-filesystem. I use cp for simple backup to a removable drive, but cp hangs on /proc/kmsg. (It also takes a long time on /proc/kcore, hopefully it sees it as a sparse file.) Is there some way to make cp skip /proc (there's no documented option I can find)? I guess I could turn off /proc altogether but supposedly some programs in the distribution use it.
Why would you need a backup of anything outside /home? Much of the system will be best rebuilt with a re-install from the CDs/DVD.

But to answer your question, if you want to do things that way, you'd probably be best off specifying particular directories in your script as opposed to a simple "cp -r / $TARGET".

There are other pseudo filesystems for which backups are not necessary. Eg: /sys & /dev. Also, you may not need/want to backup anything under /mnt, /media or /tmp.

I'd suggest something like this:

Code:
#!/bin/bash
TARGET="/mnt/backup"
cp -r /bin $TARGET
cp -r /boot $TARGET
cp -r /etc $TARGET
cp -r /home $TARGET
cp -r /lib $TARGET
cp -r /opt $TARGET
cp -r /root $TARGET
cp -r /sbin $TARGET
cp -r /usr $TARGET
cp -r /var $TARGET
There are probably quicker & neater ways of doing this using xargs and some regexp... but this would do for me.

Last edited by rkelsen; 10-29-2006 at 04:28 AM.
 
Old 10-29-2006, 12:27 PM   #3
mikanoid
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rkelsen
Why would you need a backup of anything outside /home? Much of the system will be best rebuilt with a re-install from the CDs/DVD.
After spending 3 days hacking various system files to get the radeon driver to work using dri, not to mention the ide bus to work at full speed (I think), I think I'd rather just abandon Linux rather than have to re-install from the CDs.

But thanks for suggestions. I thought I vaguely remembered that there was some cp-like utility that would skip directories containing a certain filename, or something like that...
 
  


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
hidden directories under proc... what are they for? : (/proc/.23142) syssyphus Linux - General 1 04-10-2006 03:23 PM
Correlation between /proc/devices and /proc/modules ColinLadyka Linux - General 1 02-13-2006 05:25 PM
/proc/bus/ieee1394 problems georgekm Linux - Hardware 0 03-05-2005 06:44 PM
/proc/pci problems and Sound issues ZeroX5 Linux - Hardware 0 06-17-2004 08:40 PM
Problems saving to proc folder Dawyea Linux - Newbie 2 05-19-2004 09:24 PM

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

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