Backup multiple directories rclone + zip users accounts /home folder

Dear reader,

I have installed GitHub - houtknots/backupscript-rclone: Backupscript based on rclone and it works fine, but i have two questions. I hope someone can help me to solve this.

  1. I like to backup multiple directories with rclone. For example, the script backups only the /home/ folder. But now i also like to backup the folder /var/backups/sql/ as well. How can i achieve this? Below the following code at this moment.

Example code:
#Folder settings
localfolder=/home/

  1. At this moment the backup is creating one big zip file of all de folders (users) within /home/ folder. Is there a option or possibility to create separated zip files from all the folders (users) within the /home folder instead of one big zipped file?

Hope someone can helps me with this.

Best regards,

Mark

hello and welcome to the forum,

you can use https://rclone.org/filtering/#include-from-read-include-patterns-from-file

create a file, let's call it include.txt

/home/**
/var/backups/sql/**

and test it using a command such as
rclone ls / --include-from=include.txt -vv

Hi,

Thank you for your reply. If i edit the file: backup.sh with the following lines, the script only backups the folder: /home/ and not the folder:/var/backups/sql/

I would like to backup both the folders, can anyone help me to achieve this?

#Folder settings
localfolder=/var/backups/sql/**
localfolder=/home/**
remotefolder=server-xx.nl
currentdate=$(date +"%Y-%m-%d_%H-%M-%S")
tempfolder=/tmp/backupscript/
tempfile="$tempfolder/$currentdate.zip"
hostname="hostname"

Besides above question/request, i also hope that someone can helps me with:

  1. At this moment the backup is creating one big zip file of all de folders (users) within /home/ folder. Is there a option or possibility to create separated zip files from all the folders (users) within the /home folder instead of one big zipped file?

Greetings,

M.

filters are reliative to the source folder.
so as per my example, set the source folder to /

as for item 2,

  • run backup.sh multuple times, setting localfolder to whatever folder you want.
  • you can modify the backup.sh

Hi,

Thank you for reply. If i change the source folder to / then the backupscript wel backups the whole server. I only want to backup localfolder=/var/backups/sql/** and localfolder=/home/.Is this possible in one backup.sh file or do i need install the backup script in two ways/folders (one for localfolder=/var/backups/sql/ and other install for localfolder=/home/**)?

I hope you can understand my story and my goal and i hope to hear soon from you.
Thanks for the help for so far!

M.

i am not an expert at bash script but i have been working on my skills.

i modified the script by changing line 87
from
zip -r $tempfile $localfolder
to
cat include.txt | zip -r@ $tempfile

and then create a text file named include.txt

/var/backups/sql/
/home/

note:
must use usezip=true.
if usezip=false, the script will not work as is.

Hi,

I think this works! You are super, i'm going to test it.
Thank you very much!

Best regards,

M.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.