add gnu style incremental backups (support >daily backups)
This commit is contained in:
parent
67b546503f
commit
a6d9c68363
1 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
tar -caf /srv/minecraft/backups/`date --iso`.tar.xz /srv/minecraft/server/
|
||||
rm /srv/minecraft/backups/`date --iso --date='14 days ago'`.tar.xz || echo "no old backups to delete!"
|
||||
|
||||
until [ ! -e /srv/minecraft/backups/`date --iso`.$i.tar.xz ]; do
|
||||
(( i++ ))
|
||||
done
|
||||
tar -caf /srv/minecraft/backups/`date --iso`.$i.tar.xz -g /srv/minecraft/backups/`date --iso`.snar /srv/minecraft/server/
|
||||
rm /srv/minecraft/backups/`date --iso --date='14 days ago'`* || echo "no old backups to delete!"
|
||||
|
|
Loading…
Add table
Reference in a new issue