Freedom Penguin

Linux Software Reviews, Discussion and Articles

  • About Us
    • Privacy Policy
    • Disclosure
    • Contact Us
  • Categories
    • How To
    • Quick Tips
    • Opinion
    • News
    • Just Ask Matt
    • Distro Review
    • The Linux Crowd
    • Software
    • Networking
    • Cloud
  • Linux FoSS Shirts
You are here: Home / Articles / How To / Finding Recent Files

Finding Recent Files

11.16.2015 by Jed Reynolds //

Finding Recent Files

Gnarly Backup School Series

Before you suggest that it is better to use a backup program like Bacula or Amanda, I shall insist that making backups from the command-line is mighty useful. In scenarios where you are running in an embedded system (Rpi, Beaglebone), or a headless server that you want to keep a minimum install footprint on, writing a just-fits backup script can often be the correct choice.

This will be the first of a series of backup articles: we will learn various aspects of the find command, and move onto ways of using rsync and find in conjunction. I’m totally sure it will be a killer trip, man.

A bunk trip for most people is reading the man page for find. It’s not a command you learn from the man page. Instead, there are numerous options and endless possibilities for confusion…unless you have a tutorial. So, little dudes, let’s begin with the general features of find:

  • There’s a way to mark paths: -path and not descend them: -prune
  • You can make file name patterns with -name “*thing1*” and -iname “*thing2*”
  • And they can be combined with AND, OR and NOT: -a, -o, !
  • But don’t stop there. ALL aspects of the unix-style file system can be queried. The most likely things we want to know are file type:-type and last modified time: -mtime.

Excellent! Or well, that’s the theory. Let’s do three beginner examples:

  1. Find assumes the current directory, which is always the first argument.
    cd ~; find -type f

    That shows way too many files. Great for a first backup…not useful for a daily backup.

  2. Getting sharper- What config files did we modify in the last day?
    find .config -type f -mtime -1

    and the last two days?

    find .config -type f -mtime -2
  3. You and I know we don’t backup every day: that’s just life. Being smart, we’ll use the date of our last backup to build up the list of files we have modified since our last backup. Getting gnarly:
    find ~/.config -type f -newer /var/backup/home-jed-2014-12-11.tgz

I’ve done my best to keep this one simple. Next edition, we’ll be making more of our backup by taking less. Dwell on using the last command above, but on your home directory. Is that what you really want to back up? Let me know below in the comments section.

Related Posts:

  • EzeeLinux Show 18.16 | Facebook, Time Out & Finding Configuration FilesEzeeLinux Show 18.16 | Facebook, Time Out & Finding…
  • Finding Solace in Solus LinuxFinding Solace in Solus Linux
Jed Reynolds
Jed Reynolds
Jed Reynolds has been known to void warranties and super glue his fingers together. When he is not doing photography or fixing his bike, he can be found being a grey beard programmer analyst for Candela Technologies. Start stalking him at https://about.me/jed_reynolds.

Categories // How To Tags // Gnarly Backup School Series

Follow Freedom Penguin

Affiliate Disclosure

Freedom Penguin is a partner with the eBay Partner Network, an affiliate program designed to provide means for a site to earn advertising fees by advertising and linking to eBay.com.

Freedom Penguin is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com

Copyright © 2019 · Modern Studio Pro on Genesis Framework · WordPress · Log in

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Necessary Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.