bash-onedrive-upload
bash-onedrive-upload copied to clipboard
Delete old files after a successful upload (aka backup mode)
When uploading backups on a regular basis it is useful to delete old backups after a successful upload, e.g. doing backups on a daily basis and only keeping these for a week.
Things to think about:
- How to activate this feature via commandline
- for example
--backupmode --max-age 7d
- for example
- How to determine which files to delete
- Checking for items in the backup base root
A full call could look like this
$ ./bash-onedrive-upload \
--backup-mode \ # Activate backup mode
--backup-basedir myBackups \ # Use remote folder myBackups as the backup root folder
--backup-date-pattern '+%Y-%m-%d' \ # Create a subfolder with this name in the backup base dir
--backup-max-age 7d \ # Delete all files older than 7 days after a successful upload
myBackupFiles.gpg # Upload these files
Hi! I actually need something that will delete the files after successful upload. I have a cron job that basically goes into a folder and uploads everything to onedrive. I don't need anything fancy - simply delete whatever was just uploaded.
How difficult would it be to implement something like that? Thanks!