Skip to content

Instantly share code, notes, and snippets.

@yujinyuz
Forked from rampion/backup.crontab
Created October 25, 2020 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yujinyuz/827ab1977fc81173569558c81a5eaa03 to your computer and use it in GitHub Desktop.
Save yujinyuz/827ab1977fc81173569558c81a5eaa03 to your computer and use it in GitHub Desktop.
better vim backup strategy
# clean up any backups not used in the past 7 days out of the ~/.backup directory
@daily find ~/.backup -type f -name '*;*' -not \( -atime 0 -or -atime 1 -or -atime 2 -or -atime 3 -or -atime 4 -or -atime 5 -or -atime 6 \) -delete
" set where to write backups to
set backupdir=~/.backup
" and the backup extension
au BufWritePre * let &bex = substitute(expand('%:p:h'), '/', ':', 'g') . strftime(';%FT%T')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment