Skip to main content

Simple linux backup controled by a YAML file.

Project description

me-backup

Install

Baixar o pacote do PIP.

    $ sudo python -m pip install me-backup

Para testar a instalação, rode o comando de help:

    $ sudo python -m me_backup --help   
    Usage: python -m me_backup [OPTIONS] COMMAND [ARGS]...

    Options:
    --help  Show this message and exit.

    Commands:
    install  Create needed files (run with sudo).

Caso não exista nenhuma instalação anterior em /etc/me-backup, simplesmente chame o módulo dentro da instalação de python do sistema usando sudo. Isso irá abrir um formulário para instação dos recursos.

Neste caso, é exigido uso de privilégio, porque o pacote irá realizar alterações na pasta /etc/me-backup e no cron do usuário informado na instalação em /var/spool/cron/.

    $ sudo python -m me_backup install
    
    Me-backup never runned, this follow steps will create the tool folder and config file into /etc/me-backup! (need sudo)
    Default User: [lucas] 
    Users shell rc: [/home/lucas/.zshrc]
    Task file: [/etc/me-backup/tasks.yaml] 
    Log path: [/etc/me-backup/mebk.log] 
    Log level: [INFO] 
    Default host: [127.0.0.1]               
    Default crontab path: [/var/spool/lucas]

Pronto! Rodando o help novamente, outros comandos para uso serão listados.

    $ sudo python -m me_backup --help
    
    Usage: python -m me_backup [OPTIONS] COMMAND [ARGS]...

    Options:
    --help  Show this message and exit.

    Commands:
    generate_yaml  Create a tasks.yaml model file.
    print_rsync    Return the rsync command
    run_now        Run the backup tasks right now.
    schedule       Schedule the tasks to run using your time configurations.

Dentro da pasta /etc/me-backup o arquivo tasks.yaml será criado. Nele existe uma tarefa de modelo pré-configurada:

    tasks:
    - name: backup home
        slug: bkp_home
        src: /home/lucas/Arduino
        remote_src: False
        dst: /mnt/storage/backup/TESTE/dst1/Arduino
        remote_dst: False
        copy_config:
        type: sync
        wake_on_lan:
        enabled: False
        mac_address: 'd8:9c:67:07:87:e3'
        frequency:
        shortcut: daily
        exclude:
        extensions:
            - txt
        folder:
            - .ssh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

me_backup-0.1.24.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

me_backup-0.1.24-py3-none-any.whl (13.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page