LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-29-2021, 04:33 AM   #1
shimonl
LQ Newbie
 
Registered: May 2009
Posts: 13

Rep: Reputation: 0
LuckyBackup as root between 2 computers on a home LAN


Hi,
My desktop PC has multiple users.
I run LB nightly (cron) as root, with tasks which back up home data to an external backup drive. A task for /home/shimon/Documents, one for /Pictures, for /home/mrs-shimon/Documents, etc.

My daughter uses a separate desktop PC, on the same LAN (the ADSL wifi+wired router).

I am not managing to get LuckyBackup (or actually, I guess rsync in the background) to backup her data to the external drive. It has a /backups/LuckyBackup folder with subfolders /shimon (including /Documents, /Pictures), /mrs-shimon, with subfolders by backup source, etc.

So, on her computer I also want the backup to be running from root, since, as I understand things, that would be the only way to write to the <backup drive>/backups/LuckyBackup/daughter/Documents folder.

I have found a few people online who say they have managed to do this, e.g. @pizzipie (at this post ) who says
Quote:
My experience is limited to transferring files within my LAN. I have used 'rsync', luckyBackup (which uses 'rsync' and which I learned about 'rsync' from)
but I can't find exact steps to follow. (I would have sent a PM to @pizzipie but I can't find such a function here on LQ).

My current command in LB is:
Code:
rsync -h --progress --stats -r -tgo -p -l -D --update --protect-args --password-file=/root/********* /home/daughter/Documents/ root@10.X.X.X::/backups/LuckyBackup/Daughter/
Running that just now I got:
Quote:
ERROR: The remote path must start with a module name not a / rsync error: error starting client-server protocol (code 5) at main.c(1657) [sender=3.1.3]
I am attaching an image of the "Remote" page of LB for this job.

Thank you for any help!
Shimon
Attached Thumbnails
Click image for larger version

Name:	LB Remote.jpg
Views:	10
Size:	59.7 KB
ID:	37596  
 
Old 10-29-2021, 08:52 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Unfortunately you can not send a PM until you are a Senior Member which is 1000 posts and pizzipie does not have email enabled.

In the linked thread pizzipie was trying to configure rsync over ssh and you have configured luckybackup to use the rsync daemon. The rsync daemon must be configured /etc/rsyncd.conf which is where modules are defined.

You can use ssh if desired by creating keys and selecting ssh in luckybackup configuration.
 
Old 10-29-2021, 11:07 AM   #3
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Might I suggest a different approach? Use sshfs instead of a regular rsync. Mount as such with root ssh keys and no password

https://www.digitalocean.com/communi...stems-over-ssh

Code:
sshfs heruser@hercomputer:/home /mnt/herhome
Then just run your backup from that mounted folder rather than trying to work with rsync over the network. This makes it so you can run your backup from a single location and pull them from machines rather than trying to remote to push.

Simple script idea. I've used something similar in the past.

Code:
#!/bin/sh

# you could mount root@hercomputer if you choose of course #
sshfs heruser@hercomputer:/home /mnt/herhome
backup program /mnt/herhome /backup/location
umount /mnt/herhome
This is what I use. In my case I just have the global nfs share on the server and can backup directly to it. But you can hack in ways for them to be able to do their own restorations. In my case with duplicity / deja-dup. I do this as I don't leave my desktops on. they are off most of the time. This way they can push their own whenever they are able to do so.

Code:
#!/bin/sh
# tadaen sylvermane | jason gibson
# backups with duplicity via cron accesible with deja-dup gui front end

set -x

# variables #

PATH=/usr/bin
BACKUPPATH=/snapraid/pool/backups/lan
BACKUPTARGET="$BACKUPPATH"/$(uname -n)
NOW=$(date +%F-%H%M)
LOGFILE=/var/log/localbackups/"$1"."$NOW".log


# create logging directory #

[ -d $(dirname "$LOGFILE") ] || mkdir -p $(dirname "$LOGFILE")

# confirm mount of target removable drive #

#if mountpoint -q "$BACKUPPATH" ; then
#	[ -d "$BACKUPTARGET" ] || mkdir -p "$BACKUPTARGET"
#else
#	echo "removable drive not mounted" >> "$LOGFILE"
#	exit 1
#fi

# functions #

global_backup_func() {
	# create current backup #
	duplicity \
		--exclude-if-present .nobackup \
		--no-encryption \
		--full-if-older-than 1M \
		"$1" file://"$2"
	wait
	# clear old backups #
	duplicity remove-all-but-n-full 4 \
		--force \
		file://"$2"
	wait
}

user_backup_func() {
	if [ -d /home/"$1" ] ; then
		# create customized launcher for deja dup #
		BULAUNCHER=/home/"$1"/.local/share/applications/org.gnome.DejaDup.desktop
		if [ ! -f "$BULAUNCHER" ] ; then
			mkdir -p $(dirname "$BULAUNCHER")
			cp /usr/share/applications/org.gnome.DejaDup.desktop "$BULAUNCHER"
			chown -R "$1":"$1" /home/"$1"/
			# -z added to only replace first instance #
			sed -i -z "s|Name=Backups|Name=RestoreBackups|" "$BULAUNCHER"
			sed -i -z "s|Exec=deja-dup|Exec=x-terminal-emulator -e \"${0} restore\"|" "$BULAUNCHER"
		fi
		# create directory for user backups #
		if [ ! -d "$BACKUPTARGET"/HOME/"$1" ] ; then 
			mkdir -p "$BACKUPTARGET"/HOME/"$1"
		fi
		chown -R "$1":"$1" "$BACKUPTARGET"/HOME/"$1"
		# create backup #
		# adjusted to loop through each user via su rather than running global as
		# as root.
		su -c ". ${0} && global_backup_func /home/${1} ${BACKUPTARGET}/HOME/${1}" \
		"$1" >> "$LOGFILE"
		# locks down permissions #
		find "$BACKUPTARGET"/HOME/"$1"/ \
			-type d \
			-exec chmod 700 {} \;
		find "$BACKUPTARGET"/HOME/"$1"/ \
			-type f \
			-exec chmod 600 {} \;
	else
		echo "directory does not exist" >> "$LOGFILE"
	fi
}

case "$1" in
	userbackup)
		for user in /home/* ; do
			if [ "$user" != /home/lost+found ] ; then
				echo "#backing up user $(basename ${user})" >> "$LOGFILE"
				user_backup_func $(basename "$user")
			fi
		done
		# log cleanups #
		find $(dirname "$LOGFILE")/ -type f -name '*log' -mtime +30 -exec rm {} \;
		;;
	crontabs)
		global_backup_func /var/spool/cron/crontabs "$BACKUPTARGET"/CRON
		;;
	configetc)
		dpkg --get-selections > /etc/apt/packagelist.packages
		global_backup_func /etc "$BACKUPTARGET"/ETC
		;;
	restore)
		gsettings set org.gnome.DejaDup backend "local"
		gsettings set org.gnome.DejaDup.Local folder \
		"${BACKUPTARGET}/HOME/${USER}"
		deja-dup
		;;
esac

# end script #

Last edited by jmgibson1981; 10-29-2021 at 11:13 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cannot run root-programs from menu (Gparted; luckyBackup) on current brobr Slackware 9 01-02-2021 03:47 PM
Luckybackup Root version doesn't open userzero Linux - Software 5 03-30-2020 06:24 AM
(NeverMind) LuckyBackup Question joegumbo Linux - Software 1 03-27-2010 02:11 PM
LXer: Luckybackup - A powerful, fast and reliable backup & sync tool LXer Syndicated Linux News 0 12-14-2009 10:40 PM
LXer: Creating Backups With luckyBackup On An Ubuntu 9.04 Desktop LXer Syndicated Linux News 0 08-20-2009 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration