laurent22 / rsync-time-backup

Time Machine style backup with rsync.
3.38k stars 446 forks source link

Question: Delete old backups #169

Open anpfeff opened 4 years ago

anpfeff commented 4 years ago

I am using this tool for quite a while. Recently, the space on my external hard drive that I use for backups has become full (my file manager says: "0B free"), so I want to delete some backups now. Since I'm not sure whether I'm deleting something important like hard links, I'd like to ask for a safe deletion concept. Let's assume that I have the following backups (contains almost the entire / directory): 2019-01-15 2019-02-15 2019-03-15 2019-04-15 2019-05-15 2019-06-15 2019-07-15 2019-08-15 2019-09-15

Can I now delete, for example, 2019-03-15, 2019-05-15, and 2019-07-15 in a safe way with e.g. rm -rf? If not, what would you suggest to free up some disk space?

Thank you in advance!

laurent22 commented 4 years ago

The script should normally auto-delete old backups based on a special algorithm - it's not doing this?

Otherwise, yes you can delete any of these safely with rm -rf. The system keeps a counter of each hard link and as long as that counter is 1 or above, it will keep a copy of the base file, regardless of its location.

kapitainsky commented 4 years ago

rm -rf is right. The way how hard links work makes it safe to delete any past backup - as long as you keep the latest one all will perfectly fine.

rsync-time-backup has also option to take care of it itself - if there is no space left it can start deleting oldest backups in order to create space for new one (I thought it does it by default - check documentation)

On 28 Sep 2019, at 11:44, anpfeff notifications@github.com wrote:

I am using this tool for quite a while. Recently, the space on my external hard drive that I use for backups has become full (my file manager says: "0B free"), so I want to delete some backups now. Since I'm not sure whether I'm deleting something important like hard links, I'd like to ask for a safe deletion concept. Let's assume that I have the following backups (contains almost the entire / directory): 2019-01-15 2019-02-15 2019-03-15 2019-04-15 2019-05-15 2019-06-15 2019-07-15 2019-08-15 2019-09-15

Can I now delete, for example, 2019-03-15, 2019-05-15, and 2019-07-15 in a safe way with e.g. rm -rf? If not, what would you suggest to free up some disk space?

Thank you in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/laurent22/rsync-time-backup/issues/169?email_source=notifications&email_token=ADXJHOTHO63324B6BG5CJ63QL4YSPA5CNFSM4I3NVPI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HOJVO2Q, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXJHOVWHLPA7DL4VIVTOKTQL4YSPANCNFSM4I3NVPIQ.

fthiery commented 4 years ago

Should that issue not be closed ?

laborb-sb commented 3 years ago

I have observed something similar in my case. The hard disk fills up when multiple scripts are running. Then the delete is slower than rsync writes the new data. (My) solution is then only the hard way: reboot and then manually delete or kill rsync.