Find the answer to your Linux question:
Results 1 to 4 of 4
I've been using Code: find ~/ -depth -print0 | cpio --null -ov file .cpio to back up the date in my home directory for a while, but there's something that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    The Hot Humid South
    Posts
    602

    Backing up data w/o dot-files


    I've been using
    Code:
    find ~/ -depth -print0 | cpio --null -ov file.cpio
    to back up the date in my home directory for a while, but there's something that I'm not really liking about this method: it backs up all the dot (hidden) files along with it. All I want to really back up are my actual files, not the hidden files (which is usually program configuration). Is there any way to tell find (or some other program) to exclude the dot files?

    Thanks
    "Today you are freer than ever to do what you want, provided you can pay for it!" --Bad Religion

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,288
    Hi.

    This thread discussed that topic ... cheers, drl

    http://www.linuxforums.org/forum/lin...d-command.html
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3
    Linux Enthusiast
    Join Date
    Jun 2005
    Location
    The Hot Humid South
    Posts
    602
    Thanks, that actually works pretty well. I can't believe I missed that page when I did my search.

    Just a side not for someone looking at this later, the pipe through grep doesn't accept the -print0 find option (ending the filename with a null character instead of new line).
    "Today you are freer than ever to do what you want, provided you can pay for it!" --Bad Religion

  4. #4
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,288
    Hi, bidi.

    Did you read all the way through the thread? amitsharma_26's advice was short and straight-forward:
    Code:
    find /root/ -not -name ".*"
    where "/root/" is where you want to start. I did not understand his last post where he was explaining a part of his find solution that seemed extraneous to me, but if you omit that it seemed to work quite well.

    Compared to his, my solution was somewhat cumbersome and difficult to type, especially for folks that are not good with regular expressions. Both solutions seem to work, but I find that the best choice is usually the simplest choice. Perhaps even better is knowing that there is more than one solution .

    Finally, at one time I did not backup "dot" files, but I came to realize that, for me, I wanted to have ".login", ".tcshrc", ".vimrc", etc., so that I would not need to re-create them. I also found that it was important to try to re-load at least one file to make sure that the backup is working -- the process, the medium, etc.

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •