[HN Gopher] I don't need to clean up my desktop and downloads fo...
___________________________________________________________________
I don't need to clean up my desktop and downloads folders in macOS
(2021)
Author : ingve
Score : 43 points
Date : 2023-05-29 18:56 UTC (4 hours ago)
(HTM) web link (www.stefanjudis.com)
(TXT) w3m dump (www.stefanjudis.com)
| alch- wrote:
| I'm very happy with my system: I have ~/tmp/ with subdirs `hour`,
| `day`, `week`, `month`, `6months`, `2years`. Files in each of
| these get removed by a cronjob x time after they were
| created/modified (i.e. after an hour; a day; etc).
| */10 * * * * /usr/bin/find ~/tmp/hour/ -mindepth 1 -mmin +60
| -cmin +60 -delete 0 * * * * /usr/bin/find ~/tmp/day/
| -mindepth 1 -mmin +1440 -cmin +1440 -delete # etc
|
| Files in ~/Downloads/ are deleted in the same way, after 2 hours.
| If I download something that I want to keep "forever", I move it
| to where it belongs. Anything that is not "forever" goes into one
| of the ~/tmp/ subdirs (with a useful filename so I can trivially
| find it when I need it). You get into the habit of moving things
| out of ~/Downloads/ very quickly, and it's not very painful:
| downloaded things can almost always be re-downloaded if you
| forgot to move them.
|
| I used to have another (crude) cronjob to warn me before deleting
| files: 0 21 * * * (/usr/bin/find
| /Users/me/tmp/week/ -mindepth 1 -mtime +5 -ctime +5;
| /usr/bin/find /Users/me/tmp/month/ -mindepth 1 -mtime +28 -ctime
| +28; /usr/bin/find /Users/me/tmp/6months/ -mindepth 1 -mtime +183
| -ctime +183) | /usr/bin/sed 's/^.Users.me.tmp.//g' |
| /usr/bin/mail -E -s "will delete some ~/tmp files soon" me@domain
|
| ... but I found it unnecessary. In practice, I just take some
| margin in deciding where to put things. If I think I'll need it
| for max a week, I'll put it in tmp/month to be on the safe side,
| etc. And worst case, I can just retrieve it from my backups.
|
| I can't recommend a system like this enough. It feels like "inbox
| zero" for your filesystem; very liberating.
| mo_42 wrote:
| There was a time when I mounted ~/downloads as a tempfs. After a
| day of work, all files that I didn't put in their supposed
| location, got cleaned up.
|
| Now, I have a much simpler approach: whenever I touch a file,
| I'll put it into the right location. The downloads folder is
| mostly empty.
|
| Same principle in real life. Things have have their designated
| place and they go back there after use.
|
| Clutter simply doesn't exist in my life.
| packetlost wrote:
| Is this what it's like to not have ADHD?
| SoftTalker wrote:
| If your Mac has multiple users, putting your downloads and
| screenshots in /tmp might make them visible to anyone else logged
| in to the machine.
| dijit wrote:
| MacOS has a $tmpdir env var that you could use instead, it's
| mapped per-user.
|
| I think /tmp/ is auto-mapped to /private/tmp though, which is
| also user-specific.
| SoftTalker wrote:
| Ah I didn't know that; not a frequent Mac user.
|
| Edit: after a bit of web searching, I'm not finding any
| suggestion that /private is somehow mapped per-user. Is this
| actually true?
| dvzk wrote:
| /private and /private/tmp are shared between all users
| (including non-login users). $TMPDIR is safer for sensitive
| files, but it lacks the macOS sandboxing protection on
| ~/Downloads.
| matthew-wegner wrote:
| The article mentions /tmp is symlinked to /private/tmp
| nikanj wrote:
| This is a lot of steps for what's essentially just a cronjob
|
| @reboot rm -rf /Users/me/Downloads/*
|
| Throwing away _all_ downloads / items on the desktop is not the
| hard part. The hard part is deciding if there's any wheat in with
| the chaff.
| tommica wrote:
| The tmp folder trick I knew, but the screenshot to clipboard is
| new!
| vaughands wrote:
| I kind of like digging through the downloads folder every year or
| two though and seeing all the things I had done and explored.
|
| I copy anything useful to a NAS and then delete the rest.
| hexagonwin wrote:
| Is /tmp usually wiped on a reboot? On my slackware box the /tmp
| directory wasn't auto-clearing so I had to setup a cron job to
| wipe them every week.
| Narishma wrote:
| Off-topic but there's an obnoxious resource wasting screen
| "saver" that triggers after some time of inactivity in this
| website. I took a break and came back a few minutes later to
| blaring fan noise and drained battery from my laptop.
| sys_64738 wrote:
| It's the big files that take up most space so delete those and
| ignore the others due to the law of diminishing returns.
| WXLCKNO wrote:
| So to solve my problem I just have to do the mental effort I'm
| avoiding in the first place?
|
| My strategy is simple, I fill with my computer with crap until I
| decide I want a fresh start.
|
| Then I back up these folders to a backup/year/month folder and
| never open them again.
|
| But if I ever need that meme from 2013, maybe I'll find it.
| Eddy_Viscosity2 wrote:
| Me too. Moving them to an "archive" folder I will never open
| solves the anxiety problems of deleting something I will never
| look at again.
| deanCommie wrote:
| Re-discovering your memes from 2013 is as pleasant of a
| nostalgia trip as seeing photos of your friend from college.
|
| It's a time machine for your feelings.
| ryanjshaw wrote:
| This is the way. Do you follow the same approach with email?
| I'm sitting on 110k emails in my inbox and pondering my
| options.
| moonchrome wrote:
| Archive everything
| kitsunesoba wrote:
| I've been doing the same for over a decade (closer to 15 years)
| at this point, except instead of a folder I just create an
| image of the drive of the computer I'm backing up. The only
| problems are that navigating old backups to find things is
| starting to become a chore and duplicates abound. I think the
| next time I have a bunch of time to myself, maybe between jobs
| or something, I'm going to take a couple hours each day for a
| few days to organize it all for better accessibility.
| crazygringo wrote:
| And here I thought I was the only one.
|
| At first I just moved everything into a folder named "old" that
| sat in the same place, and eventually probably wound up having
| 20 or 30 recursive folders all named "old".
|
| It wasn't until after probably a decade of that I had the big-
| brain moment to actually bother labeling them by month+year and
| put them all at the same level in an explicit backup
| directory...
| BlueTemplar wrote:
| Are you me ? :p
| plank wrote:
| Parallel evolution: not on MacOs, place everything on desktop
| () and move it into backup folder (usually just something
| like 2023mei29) if the desktop becomes too unmanageable.
| Happy to read this solution has been thought of by others as
| well
| JacobThreeThree wrote:
| Same here. I backup once per year. No organization effort
| required.
|
| Any info I need to retrieve can be found by searching for
| filenames or the various file metadata.
| Mobius01 wrote:
| You're not alone! I had developed a habit of cleaning downloads
| and files since storage was somewhat scarce when I started
| using PCs in the 90s. Now it's so cheap that I will simply
| delete very large files, then name the folder yyyy-mm-dump and
| place it with others in a backup folder somewhere. If I ever
| have to recove disk space I will glance over and delete it
| then, but more often it has been more valuable to dig up some
| meme or image.
| iudqnolq wrote:
| I call that folder "glacier" named after the AWS product with
| the same tradeoff: easy writes in exchange for harder reads. I
| also have a physical "glacier" bin in my closet and drawer in
| my desk.
|
| It's surprisingly easy to reliably remember that I would have
| put something in the "needed infrequently when I'm willing to
| spend a few minutes looking for" drawer.
| gareve wrote:
| same, but instead of backup, I just delete the biggest
| unimportant files. I can last for years doing that, until I
| change Linux distro, new laptop, or just a fresh install
| vaughands wrote:
| Yep, in terms of just getting storage back I just simply run
| `ncdu` once a year and go for it.
| justsomehnguy wrote:
| AIf you named it anywhere sensible, otherwise 1000s of .jpgs
| horsawlarway wrote:
| I like the extra purge version of this - Exact same idea,
| except you also re-install the OS fresh.
|
| I used to do it once a year, but I'm down to once every other
| year now. Backup folders get the machine name & year, and put
| on dropbox/drive/nas/other.
|
| Entire machine is wiped, OS is installed, everything feels so
| fresh and sparkly. It's a bit like going to the dentist - not
| exactly fun, but you feel very clean for a bit afterwards.
|
| Really helps also wipe out all the other accumulating cruft you
| just don't have the time or energy to go delete.
| madeofpalk wrote:
| On MacOS reinstalling the OS 'from fresh' doesn't really do
| anything any more because the OS is installed to an immutable
| sealed volume. Reinstalling the OS is basically a no-op.
| kitsunesoba wrote:
| Though they're easily removed without a reinstall, it'll
| clear out things like startup apps and background daemons.
| Kernel extensions (which should be rare already, but still
| exist) will also get wiped.
| Kwpolska wrote:
| The OS files itself may be immutable, but you're still
| wiping your user data, all installed software, and other
| clutter stored in writeable locations.
| laserbeam wrote:
| Deleting every reboot sounds a bit aggressive. I used to have a
| .sh script in a cron job that would move downloads to a separate
| folder after 48 hours, keep them there for 3 months, then delete
| them permanently. A couple loops and some mtime checks.
|
| Abusing /tmp sounds fun as well tho.
| SheinhardtWigCo wrote:
| I found turning off the Desktop to be helpful:
| defaults write com.apple.finder CreateDesktop -bool false &&
| killall Finder
| fragmede wrote:
| Nice. Does this persist after upgrades?
| jrmann100 wrote:
| These are clever strategies!
|
| I'm too lazy to move things out of ~/Downloads, so I've just
| started using the folder as my default working directory and
| struggle to clean it out every quarter or so. /tmp (or probably
| ~/Library/Caches/TemporaryItems for my account only) being
| cleaned out on every reboot would force me to be more
| intentional.
| abathur wrote:
| I collapse the crufty locations down onto my desktop. It
| doesn't really stop me from treating it that way, but it means
| there's only one place to clean up, and creeping icon sprawl
| eventually forces me to deal with it semi-regularly (instead of
| letting it slide until it's time to wipe the device...):
| $ ls -ld ~/{Desktop,Documents,Downloads} lrwxr-xr-x
| 1 abathur staff 24 Apr 19 2020 /Users/abathur/Desktop ->
| /Users/abathur/Downloads lrwxr-xr-x 1 abathur staff
| 24 Apr 19 2020 /Users/abathur/Documents ->
| /Users/abathur/Downloads drwx------+ 233 abathur staff
| 7456 May 29 13:56 /Users/abathur/Downloads
| fragmede wrote:
| yeah. anything I can just redownload later I shove in
| downloads, anything I create or can't likely be redownloaded
| easily goes to documents
| maeriens wrote:
| Doing CMD+Shift+5 on macOS shows the full clip menu, and in the
| Options section of the bar you can select it to always store the
| cutouts to clipboard instead of a file, or always open them to
| Preview; even send them to another location.
| mlangenberg wrote:
| You can add your download folder to $daily_clean_tmps_dirs in
| /etc/periodic.conf and files not accessed for three days will
| automatically be deleted. See /etc/defaults/periodic.conf and
| /etc/periodic/daily/110.clean-tmps
| whartung wrote:
| As an aside, perhaps a bit counter to this, after quite a bit of
| searching, I have not found a way to tell macOS to NOT delete the
| /tmp folder on reboot.
|
| I have no real problem with the 7 day life span of files there,
| but since I actually do put quite a bit of "temporary context"
| into /tmp, it's a bit annoying to have it wiped out on restart.
|
| Now, yes, of course, I can simply create a new folder, create my
| own 7 day sweeper and be done with it.
|
| The simple nut is that I've been using /tmp for 30 years (like
| vi, every unix machine has a /tmp), and it's a bit hardwired into
| my muscle memory. And since the machine is supposed to do my
| bidding, not the other way around, it would be nice to be able to
| configure it to not do this.
|
| But, hardly a crisis, I'm coping.
| int0x2e wrote:
| You do realize this is exactly what /tmp/ is expected to do on
| all *nix based machines, including Macs, right? Why not create
| a new path, and use that?
| [deleted]
| karaterobot wrote:
| Changing the screenshot settings to make copying the image to
| your clipboard is good advice, it's one of the first things I do
| on a new Mac. I take maybe half a dozen screenshots a day, and
| the workflow is almost always pasting them into Slack or Jira; I
| don't need my OS to save a local copy on my desktop.
|
| I'm not sure I get the advantage of putting things into a tmp
| directory. If I have to move things out of there to avoid them
| being deleted automatically, that seems like about the same
| amount of work as just archiving important downloads and then
| deleting everything in ~/Downloads once in a while. And safer
| too. By that logic, you might as well just save your downloads in
| the Trash.
| [deleted]
| fit2rule wrote:
| [dead]
| nntwozz wrote:
| For me all downloads go to the desktop, once used/done it gets
| removed/moved. It's like a to-do list with icons.
| cloudking wrote:
| Same, Temp folder on desktop move to after done and
| periodically review / empty.
| emptyfile wrote:
| [dead]
| readyplayernull wrote:
| My downloads folder is my to-do stack, I sort it by oldest items
| and process each one, either organizing or deleting stuff.
| Whether I need to read some document, watch a movie, or install
| something I'll put it in downloads. If the system allows I'll set
| Downloads as home folder when starting the file browser.
| fzeindl wrote:
| I have a healthy mixture of organized folders, like official
| documents by years for example and disorganized folders.
|
| The key to happiness is to accept the mixture, also accept that
| you sometimes rename and reorganize stuff, that that sometimes
| makes it better and sometimes makes it worse, and that sometimes
| thinking about all of this is just procrastination, but sometimes
| it's not!
| ff_ wrote:
| I've been fighting with the automatic accumulation of downloads
| for years now - it really makes it impossible to figure out if
| whatever I downloaded can safely be deleted - so my current
| system is similar to the OP's one, but a little gentler: I have a
| launchd task that runs every day and warns "I'm about to delete
| these things that are older than two weeks", which lets me
| salvage anything I might have forgotten to archive.
|
| Source here in case it's useful for anyone:
| https://github.com/f-f/home/blob/ee0ae5dd201ac6e8ffa60fff71b...
| Brajeshwar wrote:
| If you are looking to automate some of your chores on your Mac,
| Hazel is good solution for a small price. Not related but am a
| happy customer.
|
| https://www.noodlesoft.com
| wingerlang wrote:
| Same, I use Hazel to periodically move files from Desktop >
| Downloads > Review
|
| Gives me sort of a drip feed of items to either delete or move
| to a proper folder. I also place the 'Review' folder in the
| Dock, so it is usually empty, but every now and then a file
| pops up in the preview, so I can move it somewhere.
| thejackgoode wrote:
| Well, I change laptops every ~four years at work, and the problem
| goes away by itself
___________________________________________________________________
(page generated 2023-05-29 23:02 UTC)