[SOLVED] Restoring a single folder from an Evolution backup in Ubuntu 20.04
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred to the containing directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:
Using rsync requires a careful and repeated reading of the man page. I find --dry-run (-n) and --verbose (-v) to be particularly useful.
Using rsync requires a careful and repeated reading of the man page. I find --dry-run (-n) and --verbose (-v) to be particularly useful.
I understand what the / is doing in the source section - if it is missing - it will create that folder in the destination, but you said earlier to create the target folder on the destination drive BEFORE executing the backup.
I was asking about the final / in the destination instruction. do I add the / after sun? or not
Please give me an example of a one line - complete based on my example, based on this one line - will I need to create the folder ahead or not?
What is the point of the -v / verbose argument? I am not sitting there to watch the backup? My Terminal window is NOT open either at backup time
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
When you run crontab -e, are you root or using sudo, or are you just your normal user?
I don't know where your system logs cron. See what man cron says about logs on your system.
I was asking about the final / in the destination instruction. do I add the / after sun? or not
Please give me an example of a one line - complete based on my example, based on this one line - will I need to create the folder ahead or not?
What is the point of the -v / verbose argument? I am not sitting there to watch the backup? My Terminal window is NOT open either at backup time
As I understand it, and as sgosnell has said a couple of times here, yes, the destination directory must exist prior to running rsync. rsnapshot manages that for me by creating the destination directory before running the rsync command.
DEST trailing slash: I'm not sure. I see that the command that rsnapshot created I posted in #36 has a trailing slash, but most of the examples in the man page do not. Try it both ways and see what happens.
-v is useful when doing dry runs to see what's going to be copied. I agree it's not necessary on cron runs.
When you run crontab -e, are you root or using sudo, or are you just your normal user?
I don't know where your system logs cron. See what man cron says about logs on your system.
When I run crontab -e, I just type it as it is, am I supossed to type : sudo crontab -e ?
I understand you don't see what is in front of me.
When I run crontab -e, I just type it as it is, am I supossed to type : sudo crontab -e ?
Not necessarily. As long as the files you're copying are readable by the user that's running the job (you), you don't (shouldn't) need to be root. If running your rsync command from the command line creates your backup, then you should be ok.
It's not clear to me whether or not you've successfully created a backup yet. Take the problem is steps.
set up your destination
run the rsync manually, from the command line - confirm it worked
Not necessarily. As long as the files you're copying are readable by the user that's running the job (you), you don't (shouldn't) need to be root. If running your rsync command from the command line creates your backup, then you should be ok.
It's not clear to me whether or not you've successfully created a backup yet. Take the problem is steps.
set up your destination
run the rsync manually, from the command line - confirm it worked
set up the crontab - confirm that worked.
OK, Here is what I did
1) In the target device, i created manually a folder called sun (for Sunday)
2) In teminal mode, I executed : rsync -rv /home/alex/alexfolders /media/New-SD-512/sun
3) I got error - permission denied
4) Then I ran sudo rsync -rv /home/alex/alexfolders /media/New-SD-512/sun
The command is now running and doing it!
So, why does the cron job not doing it, how can I get the cron job to run as sudo / root automatically?
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
No, weekly at the end does not run it weekly. That was just a hypothetical name of a folder on the destination. The times the command is run by cron is determined entirely by the first 5 positions in the line.
Yes, you will have to create all those folders on the destination drive. Then put a line in the crontab for each day, as shown above.
No, weekly at the end does not run it weekly. That was just a hypothetical name of a folder on the destination. The times the command is run by cron is determined entirely by the first 5 positions in the line.
Yes, you will have to create all those folders on the destination drive. Then put a line in the crontab for each day, as shown above.
OK, I ran the one line for Sunday in Terminal mode ... It finished too fast IMO... At the end, i had this message
sent 36,998,650,777 bytes received 400,345 bytes 132,851,170.99 bytes/sec
total size is 36,988,192,756 speedup is 1.00
The permissions problem is an ownership problem. Alex does not own /media/New-SD-512, root does. You have two options. Change the ownership, or run the cronjobs through the root crontab. I would probably change the ownership.
I ran the same command before , but without the / after sun.
Now I ran it again, following your example with the / at the end, I got this message
Code:
alex@alex-nuc8i7hnk:~$ sudo rsync -av /home/alex/alexfolders /media/New-SD-512/sun/
[sudo] password for alex:
sending incremental file list
sent 614,813 bytes received 3,507 bytes 1,236,640.00 bytes/sec
total size is 36,988,192,756 speedup is 59,820.47
BUT - the sun folder is still EMPTY
So,?
Any clues in the verbose output?
With no trailing / on the source, there should be a alexfolders directory in the sun directory
Incremental?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.