LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2020, 11:35 AM   #31
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212

Quote:
Originally Posted by sgosnell View Post
I think rsnapshot is a better option, but really it's just a front-end for rsync. Either can get the job done. And I agree that trying it and seeing what happens is the best way to go. Blowing things up and putting them back together again is an excellent way to learn things, and one tends to remember those things better through that process. I cannot count the number of times I've borked my systems over the years. Sometimes it was frustrating, but I always learned something from it. Often I learned a lot.
I agree about rsnapshot. I mostly like the directory management and linking-to-unchanged-files. It's a fairly complicated wrapper under the covers (it's written in perl), but it's very easy to setup, IMO.

While all you say is true, we are discussing making a backup. Set something up and try it. If the desired files are backed up, then it worked. If not, it didn't. Shouldn't bork anything to try.
Scheduling is a bit more to test, since one has to wait for the cron time to happen, although it's pretty easy to set up a schedule for one job to fire in 5 minutes from now to be sure the job will run.
Here's the crontab (in /etc/crontab) for my rsnapshot setup:
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
30 1 * * * root /usr/bin/rsnapshot daily
0  3 * * 0 root /usr/bin/rsnapshot weekly
30 2 1 * * root /usr/bin/rsnapshot monthly

Last edited by scasey; 08-21-2020 at 11:39 AM.
 
Old 08-21-2020, 04:42 PM   #32
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
That will overwrite each backup, since they are all going to the same folder, /media/New-SD-512/weekly. To keep separate backups for each day, you need a separate folder for each. That's why this method gets messy, but it should work. You can put 7 subfolders under weekly, say 1, 2, 3, etc.
Code:
0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/sunday
0 20 * * 1 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/monday
Sunday == 0, through Saturday == 6. There is no 7, which would be the 8th day of the week. You can name the destination folders anything you like - a number, the text day of the week, whatever you can remember best. The destination folders must exist before running rsync.
OK, I understand the idea of multiple subfolders, no problem.
The "Problem" is that the job failed to run at 8pm - in the log it said that it coulnd find the destination storage device...
1) The machine switches the screen OFF after 10 minutes, but does it matter?
2) The storage device is an SD 512GB card, but the file format is Not Linux, does this matter?

Cheers
Alex
 
Old 08-21-2020, 04:45 PM   #33
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
You’ll need to read the documentation for rsnapshot to learn how to configure and run it. As it automagically creates a different directory for each run, it will do exactly what you’re asking. If you don’t want weekly or monthly backups, simply don’t configure them.

Another feature of rsnapshot is that if a file is the same today as it was yesterday, it links to yesterday’s copy instead of copying the file again. This saves both time and space on the backup system.

Note that you’ll need to learn one way or the other. As noted, the documentation is on the web as well as in the man pages for the tools. We tend not to repeat here what you can read for yourself.

One other thought: Rather than asking if something will work, just try it and see what happens.
I do try many things before asking, but at times, due to being new here, I am concerned to do something that can mess it up. IN the past month, since starting with Linux - I had to install and reinstall it from scartch - SIX TIMES...

I would love to see a timeshift manual - where can I find one?

Thanks
Alex
 
Old 08-21-2020, 05:14 PM   #34
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by alex4buba View Post
I do try many things before asking, but at times, due to being new here, I am concerned to do something that can mess it up. IN the past month, since starting with Linux - I had to install and reinstall it from scartch - SIX TIMES...
Yes, that is frustrating, but as I said we're talking about a backup. It will either work or it won't. If it doesn't, no harm done.

Quote:
Originally Posted by alex4buba View Post
I would love to see a timeshift manual - where can I find one?

Thanks
Alex
I don't use it, but there's lots of help in this search. Is there a man page or a help function in your installation?

Again, it does not appear to be the tool to backup your email, which is what we've been discussing. It's designed to make a backup of your installation such that "reinstalling" becomes a simple recovery from backup instead of what you've done six times

It does look like you can set a schedule for that...I will have to look into it for my desktop. I'm using rsnapshot for my server and copying everything so I can recover from a failure quickly.

Last edited by scasey; 08-21-2020 at 05:15 PM.
 
Old 08-21-2020, 05:46 PM   #35
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
I agree about rsnapshot. I mostly like the directory management and linking-to-unchanged-files. It's a fairly complicated wrapper under the covers (it's written in perl), but it's very easy to setup, IMO.

While all you say is true, we are discussing making a backup. Set something up and try it. If the desired files are backed up, then it worked. If not, it didn't. Shouldn't bork anything to try.
Scheduling is a bit more to test, since one has to wait for the cron time to happen, although it's pretty easy to set up a schedule for one job to fire in 5 minutes from now to be sure the job will run.
Here's the crontab (in /etc/crontab) for my rsnapshot setup:
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
30 1 * * * root /usr/bin/rsnapshot daily
0  3 * * 0 root /usr/bin/rsnapshot weekly
30 2 1 * * root /usr/bin/rsnapshot monthly
I am gettting gradually more and more confused here... What is better "rsnapshot" as compared to what?
What is the root command and where is the command rsync?
What are all the commands in the above file in capital letters?

You see guys, this is all new to me

Thanks for your time
Alex
 
Old 08-21-2020, 06:00 PM   #36
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by alex4buba View Post
I am gettting gradually more and more confused here... What is better "rsnapshot" as compared to what?
What is the root command and where is the command rsync?
What are all the commands in the above file in capital letters?

You see guys, this is all new to me

Thanks for your time
Alex
I've given my opinion. I like rsnapshot's way of managing rsync backups. The rsync commands are generated by rsnapshot by the settings in the rsnapshot.conf, which has extensive documentation in it. A review of the FAQ on the website will clarify a lot of things about rsnapshot.
An example from my rsnapshot log:
Code:
[2020-08-21T01:33:58] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --exclude=/var/named --rsh=/usr/bin/ssh root@mydomain.com:/home/ /home/snapshots/daily.0/mydomain/
That happens at rsnapshot runtime, as far as I know.

You can certainly choose to just use rsync without rsnapshot. There are probably other options. I can think of at least two more.

The capital letters are assigning values to variables to define the environment. Research Linux environment variables.
The important lines in that example are the ones that run rsnapshot. Note the different schedules. The daily entry is run by cron at 0130 every day.

Last edited by scasey; 08-21-2020 at 06:05 PM.
 
Old 08-21-2020, 07:08 PM   #37
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
rsnapshot is in the major distro repositories. Just install it from Synaptic package manager, or from the command line using apt.
Hello again,

At this point in time, I am focusing on getting a backup system working, before I can have the luxory to consider efficiency and space saving. Storage device units are cheep today, I have to first figure out WHY my backup using rsync failed with not able to find the target storage device.

I think, that following you pointing out that I need to use : 0-6 and Sun,Mon... traget folders, this I have no problem, but unless I see at least once a working backup, there is no point for me to venture further into finding better backup systems.

Can you please help me with this main question?

I have a feeling that something is wrong at my end with my BIOS setup, I have another task that fails to autostart - it is a weather desktop widget...

If I go and reset the BIOS to factory default, using a dual boot with Windows it will probably stop Linux from starting... What say you?

Thank you
 
Old 08-21-2020, 07:16 PM   #38
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
New question...new thread.. (IMO) Especially that far off-topic.

Last edited by scasey; 08-21-2020 at 07:17 PM.
 
Old 08-21-2020, 07:20 PM   #39
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Tell us about the failure. What exact error did you get? How did you run the rsync command?
Show us the command you ran and the error you got, please.
 
Old 08-21-2020, 08:05 PM   #40
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
That will overwrite each backup, since they are all going to the same folder, /media/New-SD-512/weekly. To keep separate backups for each day, you need a separate folder for each. That's why this method gets messy, but it should work. You can put 7 subfolders under weekly, say 1, 2, 3, etc.
Code:
0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/sunday
0 20 * * 1 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/monday
Sunday == 0, through Saturday == 6. There is no 7, which would be the 8th day of the week. You can name the destination folders anything you like - a number, the text day of the week, whatever you can remember best. The destination folders must exist before running rsync.
I am preparing to start all over again to answer the latest question, but just want to confirm. Should this example:

0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/sunday

Not be : 0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/sunday/weekly ?

Or is it correct the way you stated it?

Thanks
 
Old 08-22-2020, 03:26 AM   #41
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by alex4buba View Post
I am preparing to start all over again to answer the latest question, but just want to confirm. Should this example:

0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/sunday

Not be : 0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/sunday/weekly ?

Or is it correct the way you stated it?

Thanks
OK, I tried again, but the job didn't run. Here is my cron file content:

00 18 * * 0 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/sun
00 18 * * 1 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/mon
00 18 * * 2 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/tue
00 18 * * 3 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/wed
00 18 * * 4 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/thu
00 18 * * 5 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/fri
00 18 * * 6 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/sat

I insereted it into the crontab file using nano through Terminal : crontab -e
Then, saved it and exited the editor, the message was : crontab: installing new crontab

Shortly after 6:00pm I looked in the logfile - please see attached, it claimed that it couldn't run the command, but I ran it mannually and the result shows below:

alex@alex-nuc8i7hnk:~$ crontab -l
00 18 * * 0 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/sun
00 18 * * 1 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/mon
00 18 * * 2 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/tue
00 18 * * 3 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/wed
00 18 * * 4 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/thu
00 18 * * 5 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/fri
00 18 * * 6 rsync -rv /home/alex/alexfolders /media/New-SD-512/weekly/sat

Can it be, that it failed executing because at the same time, There was a copy job that I ran manually to copy folders from my old external hard disk to a new one?

What am I doing wrong ? It MUST be me doing something wrong, but what?

Thank you helpers
Alex
Attached Files
File Type: log 2020-08-22_18-00-01_backup.log (1.5 KB, 11 views)

Last edited by alex4buba; 08-22-2020 at 03:27 AM. Reason: spelling mistake correction
 
Old 08-22-2020, 09:45 AM   #42
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Quote:
Originally Posted by alex4buba View Post
I am preparing to start all over again to answer the latest question, but just want to confirm. Should this example:

0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/weekly/sunday

Not be : 0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/sunday/weekly ?

Or is it correct the way you stated it?

Thanks
That depends on how you set up the folders on your SD card. I can't see your system to see how you did it. It should be however you set up the subfolders. That may be what stopped the rsync - you have to tell it exactly what to do and how to do it. Exactly. I said above that all the folders must exist in advance. I would probably dispense with the weekly folder, and just have 7 top-level folders, one for each day of the week. But you can do it however you want, as long as you know what you want and where everything is. You can use the file manager, whatever Ubuntu uses by default, to check the folder organization on the card, and change it if you don't like it.

Do not futz with the BIOS. One thing at a time. When you are trying to solve a problem, never try multiple fixes at the same time. You won't know which fixed it, if by chance it did get fixed, and you exponentially increase the chances for making things worse.

Remember, we're talking about a backup here. If the backup process fails, the worst case just results in no backup, which is what you already have. I don't know how timeshift got into the process. If you want to go that way, fine, but I've never used it, so I can't help.

Last edited by sgosnell; 08-22-2020 at 09:54 AM.
 
1 members found this post helpful.
Old 08-22-2020, 03:21 PM   #43
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Re: #42
crontab -l is not running anything, it's just listing the contents of the crontab.
Which user are you when you ran crontab -e?
What's in the cron log file? (/var/log/cron -- yours may be different)
Do each of those rsync commands work from the command line? If not, what do they return?


Again, please use code tags when posting commands or output. See link in my sig.
 
Old 08-22-2020, 03:40 PM   #44
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
That depends on how you set up the folders on your SD card. I can't see your system to see how you did it. It should be however you set up the subfolders. That may be what stopped the rsync - you have to tell it exactly what to do and how to do it. Exactly. I said above that all the folders must exist in advance. I would probably dispense with the weekly folder, and just have 7 top-level folders, one for each day of the week. But you can do it however you want, as long as you know what you want and where everything is. You can use the file manager, whatever Ubuntu uses by default, to check the folder organization on the card, and change it if you don't like it.

Do not futz with the BIOS. One thing at a time. When you are trying to solve a problem, never try multiple fixes at the same time. You won't know which fixed it, if by chance it did get fixed, and you exponentially increase the chances for making things worse.

Remember, we're talking about a backup here. If the backup process fails, the worst case just results in no backup, which is what you already have. I don't know how timeshift got into the process. If you want to go that way, fine, but I've never used it, so I can't help.
I am with you on not doing multiple things at the same time, I just pointed out another thought.
I thought, that the word weekly at the end tells cron to run it weekly, from what you say - it is not.

So, let me see - assume I have a blank target device - will I need in this case (after I drop the word weekly) create on that target drive 7 folders : sun,mon etc... in the root of the drive? Then the comman will look like this:

0 20 * * 0 rsync -a /home/alex/alexfolders /media/New-SD-512/sun - with or without the slash / at the end?

Thank you
Alex
 
Old 08-22-2020, 03:51 PM   #45
alex4buba
Member
 
Registered: Jul 2020
Posts: 624

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Re: #42
crontab -l is not running anything, it's just listing the contents of the crontab.
Which user are you when you ran crontab -e?
What's in the cron log file? (/var/log/cron -- yours may be different)
Do each of those rsync commands work from the command line? If not, what do they return?


Again, please use code tags when posting commands or output. See link in my sig.
I know that crontab -l is only showing me the list
Which user I am when I run crontab -e? How can I find out?
Cron log file? Attached a screen image of my /var/log/ folder - tere is no such file in it, can you suggest which one should I look in?

Yes, the command rsync -r runs ok

Thanks
Alex
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2020-08-23 06-47-25.png
Views:	15
Size:	113.9 KB
ID:	33957  
 
  


Reply

Tags
backup, restore



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
Newbie trying to write a simple backup script to backup a single folder Nd for school stryker759a Linux - Newbie 2 09-16-2009 08:52 AM
Permission problem with importing evolution mail from the old .evolution folder oskar Linux - Software 4 05-23-2008 08:28 PM
New installation: restoring the old home folder? Backup advices bruno321 Linux - General 4 11-18-2007 08:55 AM
weird error restoring Evolution melinda_sayang Linux - Software 4 11-08-2005 01:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 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