LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-19-2021, 12:48 PM   #1
Mark7
Member
 
Registered: Feb 2006
Location: Leicester
Distribution: xUbuntu 20.04 currently
Posts: 274

Rep: Reputation: 44
Automated Backups with Cron and ?..


Since I want it to happen whilst I'm asleep I'd rather not have to sign into Gnome keyring. So I guess Deja Dup is out of the picture
 
Old 03-19-2021, 02:37 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
And what is your question? What kind of help do you need?
Did you try to use a search engine to find automated backup tools?
 
Old 03-19-2021, 06:15 PM   #3
Mark7
Member
 
Registered: Feb 2006
Location: Leicester
Distribution: xUbuntu 20.04 currently
Posts: 274

Original Poster
Rep: Reputation: 44
What should I use? It doesn't necessarily have to have a graphical interface so long as it's fairly straightforward.
 
Old 03-19-2021, 06:23 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
I like and use rsnapshot, which uses rsync, for daily, multi-generational backups.
 
1 members found this post helpful.
Old 03-19-2021, 07:12 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Yes, rsnapshot is my favorite, too. Using hard links saves lots of disk space, gotta love that.
 
Old 03-23-2021, 07:40 PM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
create a simple rsync script to run and have cron pull it while you sleep.
 
Old 03-24-2021, 03:29 AM   #7
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,971

Rep: Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549Reputation: 1549
I use rsnapshot.

This is my section from crontab.
Code:
# Run rsnapshot backups
# Before the actual backup rotate less frequent sets before the more
# frequent sets. Oldest weekly becomes newest monthly, oldest daily becomes
# newest weekly, etc. This has the addition benefit of not having to worry
# how long the backup will take. Testing shows 15 minutes to be enough
# time between rotations
# Run monthly on first of month at 0015:
15 1 1 * * /usr/bin/rsnapshot monthly
# Run weekly on first day (Monday) of week at 0130:
30 1 * * 1 /usr/bin/rsnapshot weekly
# The sync_first option is set, run sync; if no fatal error run rotation
# Run daily every day at 0145:
45 1 * * * /usr/bin/rsnapshot sync; [ $? -ne 1 ] && /usr/bin/rsnapshot daily
# Run hourly every 8 hours starting at 0200:
#0 */8 * * * /usr/bin/rsnapshot sync; [ $? -ne 1 ] && /usr/bin/rsnapshot hourly
 
Old 03-24-2021, 05:15 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Code:
#!/bin/bash
#
###########################################################
# Created by lleb January 11, 2015
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 or version 3 of the
# license, at your option.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#############################################################
#
#
#############################################################
#
#	Backup program for laptops to Linux server using 
#	rsync -aviS
#
#############################################################

#	Veriables

RUSER=user
RHOST=server_IP
WHO=`whoami`
DOW=`date +%A`
RDIR=/path/to/Backup	# New server path <1/15/2016>
HOMEDIR="$HOME"
dtstamp="`date +%Y-%m-%d-%H:%M `"
log=${HOMEDIR}/logs/${dtstamp}-rsync.log

###############################################################

### 	Check for a logs directory, if not found create one
###############################################################

[ ! -d "${HOMEDIR}/logs" ] && mkdir -p ${HOMEDIR}/logs >> /dev/null 2>&1

###############################################################
#
#	Rsync preserving permissions
#
###############################################################

	rsync -aviS --exclude-from=${HOMEDIR}/excludes.txt ${HOMEDIR}/ ${RUSER}@${RHOST}:${RDIR}/${WHO}/${DOW}/ >> ${log} 2>&1

### 	Cleaning up log files
###############################

	find ${HOMEDIR}/logs/*.log -mtime +30 -exec rm '{}' \;

exit
Put that script in your users cron after chmod +x and you should be good. This uses an exclude file that can block directories as well as types and specific files you dont want/need to backup.
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Advice For: Secure and Automated Backups LinuxLearn Linux - Security 10 03-17-2010 05:44 AM
LXer: Do Automated Cross-Platform Network Backups The Easy Way (Part 2) LXer Syndicated Linux News 0 06-11-2006 10:21 PM
LXer: Do Automated Cross-Platform Network Backups The Easy Way LXer Syndicated Linux News 0 06-11-2006 08:21 PM
Automated Backups Matir Linux - Software 2 06-28-2005 08:55 AM
Any automated scripts to run DVD Backups? bweiss Linux - Newbie 3 04-28-2005 09:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:16 PM.

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