Giter Club home page Giter Club logo

Comments (3)

elesiuta avatar elesiuta commented on June 25, 2024

I have thought about this before, and would rather not add this feature directly to backupy for a few reasons:

  1. I currently don't have the time to test and maintain this feature with the same level of reliability you can expect from the rest of backupy
  2. From a user design standpoint I am trying to keep it simple and minimise the number of features and options
  3. There are other tools that can achieve this such as maid or you can write your own

Here's a short example for your use case that you can keep in and run from the .backupy folder (I have not tested this)

#!/usr/bin/env python3
from datetime import datetime
from os import listdir, path
from shutil import rmtree
from time import time

def clean(base_path):
    now = datetime.fromtimestamp(time())
    for dir in listdir(base_path):
        if (now - datetime.strptime(dir, "%y%m%d-%H%M")).days > 7:
            rmtree(path.join(base_path, dir))

clean("Archive")
clean("Trash")

from backupy.

elesiuta avatar elesiuta commented on June 25, 2024

I'll leave this open and may get to it someday, and if I do, I would also add the option to keep the X most recent versions of each file, and keep Y versions per week, month, year, etc.

from backupy.

Forever-A-Hermit avatar Forever-A-Hermit commented on June 25, 2024

I respect the preference to not include it for the reasons you've outlined. Thank you for providing this small Python script as a work-around. With a modification or two on my end, this will fit my use case perfectly.

from backupy.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.