# Per-user initscript equivalent
@reboot sh -c 'exec screen -wipe' &> /dev/null
@reboot rm -rf ~/.config/audacious/lock ~/.config/deluge/ipc
@reboot rm -f ~/.DCOPserver_monolith__0 ~/.ganttproject.d/* ~/java?.log
@reboot mkdir -p ~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/; cp ~/.profile_repo/supplemental/settings.sol ~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol
@reboot pkill gvfsd-metadata; rm -rf .local/share/gvfs-metadata
@reboot balooctl disable &>/dev/null
# Hack to ensure the correct keymap is set for F14 on the ATi Remote Wonder II
# so "skip ad in podcast" works reliably when I'm in bed
0,15,30,45 *    *       *       *       DISPLAY=:0 xmodmap ~/.xmodmaprc 2>/dev/null

# Morning Housekeeping
30      4       *       *       *       PATH="$HOME/bin:$PATH" ~/bin/tyt --cron
0       5       *       *       *       cd ~/Documents && $HOME/.local/bin/dosage --adult --continue @ | egrep -v 'Retrieving|Saved|Skipping|already exists'
0       6       *       *       *       truncate -s 0  ~/.xsession-errors

# Nightly housekeeping
0       0       *       *       *       cp ~/.profile_repo/supplemental/settings.sol ~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol
0       0       *       *       *       rm -f ~/.local/share/applications/wine-extension-* ~/.local/share/icons/hicolor/*/apps/application-x-wine-extension-* ~/.local/share/applications/wine/Programs
0       0       *       *       *       rm -f /mnt/Seagate_10TB/flatpak-incoming/chromium/*.torrent
0       0       *       *       *       ~/bin/purge_outbound.sh
0       0       *       *       *       chmod 600 ~/Documents/*.kdbx
1       0       *       *       *       rm -f ~/.xsession-errors{,.old}
2       0       *       *       *       rm -rf ~/incoming/gtk-gnutella-downloads/corrupt/*
#0       5       *       *       *       DISPLAY=:0 ~/bin/update_check.py
0       5       *       *       *       DISPLAY=:0 timelimit -q -t 86000 ~/src/3_DOES_WHAT_I_WANT/tw-daily/tw-daily.py
#0       5       *       *       *       DISPLAY=:0 timelimit -t 86000 urxvt -e bash --rcfile ~/bin/task_bashrc

# Rust housekeeping (Monthly cleanup)
# TODO: Exempt the cargo caches from backups and then use something like `cargo cache trim --limit 10G`
30      3       1       *       *       PATH="$HOME/.cargo/bin:$PATH" cargo cache --autoclean
0       4       *       *       *       PATH="$HOME/.cargo/bin:$PATH" cargo sweep -i -r ~/src | grep -v '^\S*INFO'
#30      4       *       *       *       PATH="$HOME/.cargo/bin:$PATH" cargo sweep -r -t 30 ~/src | grep -v '^\S*INFO'

# Nightly backup for stuff that's too volatile for DVD-Rs.
0       2       *       *       *       ionice -c3 ~/src/rdbackup_wrapper/backup.py 2>&1 | fgrep -v -f ~/.rdiff-backup_known_ok_failures | sed '/Deleting increment at time:/,/.*/d'

# PostgreSQL maintenance (nightly light, monthly full)
3       0       *       *       *       vacuumdb --analyze --quiet ssokolow 2>&1 | egrep -v '(superuser|database owner) can vacuum it'
3       1       1       *       *       vacuumdb --analyze --quiet --full ssokolow 2>&1 | egrep -v '(superuser|database owner) can vacuum it'
