Created
February 26, 2018 01:13
-
-
Save menasheh/e3fe6ed57a45333582a53539ccfecd1b to your computer and use it in GitHub Desktop.
gdrive: Delete Old Backups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FOLDER={{REPLACE WITH BACKUP FOLDER ID}} | |
KEEP=5 | |
gdrive list --no-header -q "'$FOLDER' in parents" | cut -d " " -f1 | tail -n +$(expr $KEEP + 1) | xargs -n1 -I id gdrive delete id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment