MYHREN.ORG

Move along, there is nothing to see
  • Home
  • About me
    • Curriculum Vitae
  • My travels
    • Vanuatu
    • Hong Kong
    • Fisketur i Rogen
  • Technical stuff
    • Networkmanager and openvpn
    • About this site
    • Nifty linux commands
    • Installere UTorrent
  • Guestbook
  • Photos
    • Australia
    • Helena
    • My photos
      • Fisketur i Rogen

Find & copy

February 5, 2009

I had a need to get find a few files that had been added or modified within the last 14 days and make a backup of those files.
Not to big of a problem, except that they were hidden amongst 90,000+ other files.

Find to the rescue! The operation comes in two parts.

First I need to create a mirror of the directory structure.

find /exports/ -mtime -14 -type d -exec mkdir -p /root/backup/{} \;

Then we backup the files

find /exports/ -mtime -14 -type f -exec cp -pf '{}' '/root/backup/{}' \;
Source:
http://linux.dsplabs.com.au/find-replicate-mirror-copy-complex-directory-and-file-structure-using-hard-links-p44/
Categories
Technolgy
Comments rss
Comments rss
Trackback
Trackback

« Dette er en test fra Windows Live Using rsync to update a samba share from windows »

Leave a Reply

Click here to cancel reply.

Pages

  • About me
    • Curriculum Vitae
  • Guestbook
  • My travels
    • Fisketur i Rogen
    • Hong Kong
    • Vanuatu
  • Photos
    • Australia
    • Helena
    • My photos
      • Fisketur i Rogen
  • Technical stuff
    • About this site
    • Installere UTorrent
    • Networkmanager and openvpn
    • Nifty linux commands

Gallery

Kryssing av bekk Klar for tur

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Spam Blocked

46,817 spam comments
blocked by
Akismet
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox