Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zeva

macrumors member
Original poster
Jan 22, 2023
32
6
hi,
While I'm familiar with the merits of other backup systems/options, I use the rysnc backup utility to backup my documents.

During a backup:
  1. How can I either take a backup list of all installed apps, preferably with their version numbers? or
  2. Which directory contains all my apps, preferably with any config that I've applied, so I can backup that entire directory?
I've moved to Mac from Windows, and notice but don't yet fully understand how Mac treats some installs differently than others. For example some which appear in LaunchPad can be deleted easily through the Mac built-in process, while others don't do that. Please confirm, for my question above if the solution you describe will cover all apps installed, or only apps which are installed through the App Store etc.

Thank you
 

TorbenIbsen

macrumors regular
Feb 22, 2021
176
153
hi,
While I'm familiar with the merits of other backup systems/options, I use the rysnc backup utility to backup my documents.

During a backup:
  1. How can I either take a backup list of all installed apps, preferably with their version numbers? or
  2. Which directory contains all my apps, preferably with any config that I've applied, so I can backup that entire directory?
I've moved to Mac from Windows, and notice but don't yet fully understand how Mac treats some installs differently than others. For example some which appear in LaunchPad can be deleted easily through the Mac built-in process, while others don't do that. Please confirm, for my question above if the solution you describe will cover all apps installed, or only apps which are installed through the App Store etc.

Thank you
Do like you are supposed to in the Apple World. - Use the Time Macine app and an external disk to take bacup. And read how Time Machine works. It is very different from an old-fashioned, static backup. It is "incremental". The very first backup will be a total backup. From there on there will be an hourly backup of the CHANGES made to the original backup. So if you over 3 days edit some file and leave it for a month, then you can use Time Machine to recover any of the versions. Because the "restore" you request will be the sum of the original document plus/minus the edits which were made until the date you request as the restore point. - Deleted files will also be kept. They are the original file plus the change of being deleted. So you just go back in time until right before you deleted the file on the Mac.

Don't spend time on setting Time Machine up in particular ways. The default settings are what you want.
 

zeva

macrumors member
Original poster
Jan 22, 2023
32
6
hi @chabig thank you for this suggestion. The requirement is to capture this list at each time of backup, please do do you know how this data can be accessed from a file?

hi @TorbenIbsen , thanks. I'm using rsync.
 

chabig

macrumors G4
Sep 6, 2002
11,450
9,321
The requirement is to capture this list at each time of backup, please do do you know how this data can be accessed from a file?
I have no idea how you might do this programmatically.
 

bogdanw

macrumors 603
Mar 10, 2009
6,118
3,030
  1. Which directory contains all my apps, preferably with any config that I've applied, so I can backup that entire directory?

Apps are in /Applications.
Your settings for the apps are in ~/Library.
Depending on the app, they can be directly in that folder, in Application Support, Containers and Preferences.
 

bogdanw

macrumors 603
Mar 10, 2009
6,118
3,030
You could try the 'lsregister' command:
/eclecticlight.co/2019/03/25/lsregister-a-valuable-undocumented-command-for-launchservices
That's from 2019, so it might be in a different place in more recent OSes, or it might be gone.
It’s still there in Big Sur, Monterey and Ventura, but I don’t know how would it be helpful.
These are the options
Code:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister  
lsregister: [OPTIONS] [ <path>... ]
                      [ -apps <domain>[,domain]... ]
                      [ -libs <domain>[,domain]... ]
                      [ -all  <domain>[,domain]... ]

Paths are searched for applications to register with the Launch Service database.
Valid domains are "system", "local", "network" and "user". Domains can also
be specified using only the first letter.

  -delete       Delete the Launch Services database file. You must then reboot!
  -kill         Reset the Launch Services database before doing anything else
  -seed         If database isn't seeded, scan default locations for applications and libraries to register
  -lint         Print information about plist errors while registering bundles
  -lazy n       Sleep for n seconds before registering/scanning
  -r            Recursive directory scan, do not recurse into packages or invisible directories
  -R            Recursive directory scan, descending into packages and invisible directories
  -f            force-update registration even if mod date is unchanged
  -u            unregister instead of register
  -v            Display progress information
  -gc           Garbage collect old data and compact the database
  -dump [table] Display full database contents after registration
  -h            Display this help

Running dump reminded me of Matrix :)
Code:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump
 

chown33

Moderator
Staff member
Aug 9, 2009
10,999
8,887
A sea of green
The -dump option of lsregister dumps everything about every known app. Parse it up to pick out things like location on disk, version, etc. Not necessarily a simple task, but it should be fairly comprehensive. Since the OP mentioned doing this at the time of a backup, I assume it would mostly be an automated process.
 

bogdanw

macrumors 603
Mar 10, 2009
6,118
3,030
In my opinion, the OP should understand that there is no point in backing up preinstalled apps because they can't be restored.
Just as well, there is no reason to back up apps like Chrome, that are updated every week.
So, in my opinion, just the apps' settings are worth backing up.
 

MacCheetah3

macrumors 68020
Nov 14, 2003
2,285
1,226
Central MN
I've moved to Mac from Windows, and notice but don't yet fully understand how Mac treats some installs differently than others. For example some which appear in LaunchPad can be deleted easily through the Mac built-in process, while others don't do that.
In Launchpad, the delete/remove “X” only appears for software applications downloaded via the App Store, not those via Web or other sources.

During a backup:
  1. How can I either take a backup list of all installed apps, preferably with their version numbers?
I am not sure on a method to initiate it during a backup, although, perhaps Automator — which I have little experience. Nonetheless, to obtain software application information, you can use CLI utilities system_profiler and grep via Terminal.

For your use case, the following outputs the information for software applications in the Applications folder to a basic/simple text file on the Desktop:

Code:
system_profiler SPApplicationsDataType | grep "Location: /Applications/" -B 7 > ~/Desktop/Applications_list.txt


*** Manual Pages ***

Code:
SYSTEM_PROFILER(8)          System Manager's Manual         SYSTEM_PROFILER(8)

NAME
     system_profiler – reports system hardware and software configuration.

SYNOPSIS
     system_profiler [-usage]
     system_profiler [-listDataTypes]
     system_profiler [-xml] dataType1 ... dataTypeN
     system_profiler [-xml] [-detailLevel level]
     system_profiler [-json] dataType1 ... dataTypeN
     system_profiler [-json] [-detailLevel level]

DESCRIPTION
     system_profiler reports on the hardware and software configuration of the
     system.  It can generate plain text reports or XML reports which can be
     opened with System Information.app, or JSON reports

     Progress and error messages are printed to stderr while actual report
     data is printed to stdout.  Redirect stderr to /dev/null to suppress
     progress and error messages.
   
      The following options are available:

     -xml                Generates a report in XML format.  If the XML report
                         is redirected to a file with a ".spx" suffix that
                         file can be opened with System Information.app.

     -json               Generates a report in JSON format.

     -listDataTypes      Lists the available datatypes.

     -detailLevel level  Specifies the level of detail for the report:

                         mini          report with no personal information

                         basic         basic hardware and network information

                         full          all available information
   
    -timeout            Specifies the maximum time to wait in seconds for
                         results.  If some information is not available within
                         the specified time limit then an incomplete or
                         partial report will be generated.  The default
                         timeout is 180 seconds.  Specifying a timeout of 0
                         means no timeout.

     -usage              Prints usage info and examples.
   
EXAMPLES
     system_profiler
       Generates a text report with the standard detail level.

     system_profiler -detailLevel mini
       Generates a short report containing no personal information.

     system_profiler -listDataTypes
       Shows a list of the available data types.

     system_profiler SPSoftwareDataType SPNetworkDataType
       Generates a text report containing only software and network data.

     system_profiler -xml > MyReport.spx
       Creates a XML file which can be opened by System Profiler.app
     
AUTHORS
     Apple Inc.

Darwin                           June 30, 2003

 
Last edited:
  • Like
Reactions: chown33 and bogdanw

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
ls /Applications > ~/Documents/apps_list.txt

OP you can run this from Terminal and it will give you a list of all your apps saved to the file apps_list.txt in your Documents folder.

I run this as a Workflow in the Alfred launcher app, but you can run it manually in Terminal.
 

HDFan

Contributor
Jun 30, 2007
7,290
3,342
The recommended backup strategy is a 3-2-1. Only one of these should be TM due to its unreliability. The other 2 could be clones such as those made by Carbon Copy Cloner.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
That’s very good, unless some apps are in folders.
In that case, something like
Good idea, but it does not seem to work. I tested and get the same result as my script that does not show anything in /Applications/Utilities.

I never really worried about since that /Applications/Utilities for me only contains the default apps installed from Apple. I take your point thought that some users might have apps installed in other folders under /Applications.
 

bogdanw

macrumors 603
Mar 10, 2009
6,118
3,030
Both ls /Applications and find /Applications return results from /Volumes/Macintosh HD – Data/Applications, not from /Volumes/Macintosh HD/System/Applications/
 

zeva

macrumors member
Original poster
Jan 22, 2023
32
6
Hi

@bogdanw, Excellent, I wasn't sure if non App Store apps might be installed somewhere else. These are both very helpful. Thank you

@chown33, @bogdanw, @MacCheetah3,

My intention isn't to back the apps up, it's simply to know what was installed. That way if I lose and replace my Mac, I can quickly run through my last backup list and install everything that was and is still needed. Trying to do this from memory is too hard, and not remembering apps means for some time after I'll go to use something and it's missing. This back up list will make life easier. And capturing the versions is also handy as in some cases the latest version may not be desired.

The lsregister looks like a great option. I will investigate further. Thank you

@MacCheetah3, thanks for your additional advice, I will investigate Automator

@Weaselboy, this is really helpful, that's a great way to capture the application list. Thank you

@bogdanw, thank you for your additional suggestion on capturing the application list.

Wow, this has been a very helpful set of answers. Thank you all 🙏
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.