Skip to content

crgc/podsweep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

podsweep

Automatically deletes Apple Podcasts' StreamedMedia cache on a schedule, reclaiming disk space consumed by streamed (not downloaded) episodes.

Apple Podcasts accumulates streamed audio in a temp directory and never cleans it up. This agent wipes it every hour via a macOS LaunchAgent — no manual intervention needed.

Target directory:

~/Library/Containers/com.apple.podcasts/Data/tmp/StreamedMedia

Install

git clone https://github.com/crgc/podsweep.git
cd podsweep
make install

make install generates the plist with your paths and loads the agent. It runs immediately on load, then every hour.


Stop / uninstall

make unload
rm ~/Library/LaunchAgents/com.podsweep.podcasts-cleanup.plist

Monitor

Check the agent is loaded:

make status

A line with com.podsweep.podcasts-cleanup means it's running. The first column is the last exit code (0 = success, - = not yet run).

Follow the log:

make logs

Run once manually:

make run

Makefile

Target What it does
make install Generates the plist with your paths and loads the agent (one-time setup)
make reload Unloads + reloads — use after any changes
make run Runs the script directly, outside of launchd
make logs tail -f the log
make status Shows the launchctl entry with exit code
make lint Validates the plist XML

Log file: ~/Library/Logs/podsweep.log


Permissions

launchd agents run in a stripped environment with no TCC entitlements by default.

Full Disk Access

~/Library/Containers/ is sandboxed and requires Full Disk Access. Scripts invoked by launchd do not inherit it from your user session, so rm -rf will get Operation not permitted even though the same command works in Terminal.

Fix:

  1. Open System Settings → Privacy & Security → Full Disk Access
  2. Click + and add /bin/zsh
  3. Run make reload

$HOME is not set

launchd's default environment does not include $HOME. The script in this repo reads it from the environment at launch time — if you modify the script, avoid assuming $HOME is set unless you've verified launchd passes it.


Troubleshoot

Symptom Check
Agent not in make status output Re-run make install; verify the plist was written to ~/Library/LaunchAgents/
Non-zero exit code in make status Check ~/Library/Logs/podsweep.log for the error message
Plist rejected on load Run make lint to validate the XML
Target dir not found Normal — the script exits cleanly. The dir reappears when Podcasts next streams something.
Operation not permitted in log /bin/zsh needs Full Disk Access. See Permissions.
Agent doesn't survive reboot LaunchAgents load at login — verify the plist is in ~/Library/LaunchAgents/

About

Automatically deletes Apple Podcasts' StreamedMedia cache on a schedule

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors