Backing up a designated folder with cyclical repetition
Hey, today I will introduce you to a small bash script, which backs up a given folder on our server at a given time or day, possibly every few minutes.
script:
1 2 3 4 5 6 7 | #!/bin/bash DATA=`date +"%b-%d-%y"` NAZWAPLIKU="backup-$DATA.tar.gz" ZRODLO="/home/linux" KDOCELOWY="/home/backup" tar -cpzf $KDOCELOWY/$NAZWAPLIKU $ZRODLO |
A catalog should be provided with the SOURCE, what we want to pack, while for KDOBELOWY we provide the path to the folder, where the copy should be. File should be given permissions 700.
Permissions:
1 | chmod 700 nazwaskryptu.sh |
If we want to, for the script to run itself, add it to the cron, (we enter in the terminal):
1 | crontab -e |
Then add it to the file, which we opened with the command above:
1 | 00 01 * * * /sciezka_do_skryptu/nazwaskryptu.sh |
Thanks to this, our script will run every day at 01:00 in the night
Related entries:
Changing the exif data of a photo in the Linux terminal
SMPlayer Installing on Ubuntu
dl.flathub.org/repo/appstream/org.videolan.VLC.flatpakref
how to pack and unpack files on the server - ZIP TAR TAR.GZ
gconf-service gconf-service-backend gconf2-common libappindicator1 libc++1 libc++1-9 libc++abi1-9 libdbusmenu-gtk4 libgail-common libgail18 libgconf-2-4 libgtk2.0-0 libgtk2.0-bin libgtk2.0-commonAll-in-one voice and text chat for gamers
All-in-one voice and text chat for gamers that's free 22.04





