backup compress and rsync

  • Hello All!


    I have some hds inside OMV and one usb hd to backup
    So, I made a script like this:


    origem = from what folder
    destino = destination folder
    data e nome do arquivo de backup = date and file name backup
    compactando o pacote tar para bzip2 = compact tar file to bz2
    apagar backup a mais de 10 dias = erase file backup after 10 days



    #!/bin/bash


    # origem da pasta
    origem="/media/7ca97618-8a6b/sambkp"


    # destino
    destino="/media/7ca97618-8a6b/bkpcomp/"


    # data e nome do arquivo de backup
    prude_bkp=bkp-prude$(date +%d-%m-%Y-%H-%-M).tar


    # tar
    tar -czvf ${destino}${prude_bkp} ${origem}


    # compactando o pacote tar para bzip2
    bzip2 -9 /media/7ca97618-8a6b/bkpcomp/*.tar


    # apagar backup a mais de 10 dias
    find /media/7ca97618-8a6b/bkpcomp -mtime +10 -exec rm {} $


    My doubt:


    until the script do tar file, its works fine,
    but to compress bz2 and erase file backup after 10 days, OMV give me erros:


    line 20: bzip2: command not found
    find: `/media/7ca97618-8a6b/bkpcomp': No such file or directory


    Why?


    I tested the script in other machine and it works!


    I am sorry my English


    Thanks your attention and help


    Douglas

    Douglas Giovani Oechsler
    Prudentópolis-PR-Brazil

    • Offizieller Beitrag

    The bzip2 package isn't installed by default on OMV installation. apt-get install bzip2

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • The bzip2 package isn't installed by default on OMV installation. apt-get install bzip2

    Thanks your reply!


    Yes, I know. At the first time when I tested a litlle script, OMV show me that bzip2 has not intalled. So I installed as you show the command, but it does not works. I did read some blogs/sites to search what can be wrong and try write script different modes to fix, but it give the same error.


    Thank you!

    Douglas Giovani Oechsler
    Prudentópolis-PR-Brazil

    • Offizieller Beitrag

    Not sure why it isn't working then. I just tried the same commands manually and they work. Your tar command is actually creating gzip'd tar files though because you are specifiying the 'z' flag. I'll have to try it in script form.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    This is working on my system:


    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hello Ryecoaaron


    I would like to thank you for your attention and help
    I wiil to test the script here!


    Thank you so much and congrats about your forum work and attention!

    Douglas Giovani Oechsler
    Prudentópolis-PR-Brazil

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!