Backup Helper

A simple script which uses rsync, yad and xterm programs in PC version.

BACKUP-HELPER.zip

BACKUP-HELPER-PC.zip

Code:


#!/bin/bash
##
## RJP 18.3.2024 a simple script for helping to make backups or copying files
## rsync and yad must be installed
# Edit 23.3.2024 an another dialog added
#
yad --text="Choose files to backup" --title="BACKUP HELPER"
FILE=$(yad --center --width=500 --height=100 --file --multiple)
yad --text="Choose a destination" --title="BACKUP HELPER"
PLACE=$(yad --center --width=500 --height=100 --file --directory)
echo "$FILE" > /tmp/output
echo "$PLACE" > /tmp/place
sed 's/|/ /g' /tmp/output > /tmp/files
sed "s/ /\n/g" /tmp/files > /tmp/files2
sleep 1
yad --form --columns=3 --width=500 --text="THIS IS EXECUTE WINDOW:" \
--field="Copy files to the chosen directory":fbtn "x-terminal-emulator -e bash -c 'rsync -av --ignore-errors $(cat /tmp/files) $(cat /tmp/place); exec bash' & " \
--button=gtk-cancel: