Buck up using rsync

17 respuestas [Último envío]
GNUbahn
Desconectado/a
se unió: 02/19/2016

I use grsync to make copies of e.g. my home folder.

What is the difference - if any - from copying with and without checking the make backup option?

pragmatist

I am a member!

Desconectado/a
se unió: 03/03/2016

"...with and without checking the make backup option?"

Are those the exact words used? Could you post a screenshot?

Looks like there are a lot of answers from here:
http://www.opbyte.it/grsync/

GNUbahn
Desconectado/a
se unió: 02/19/2016

I've tried to read me clever but so far I've failed.

When running grsyng I choose to copy files under certain arguments. One of the advanced options is 'Make backup' [1]. Hovering gives the explanation [2].

If I had an extra external harddrive I might just try, but I'm not sure I would be able to tell the difference...

[1]: Grsync: default [2]: Tool_tip
pragmatist

I am a member!

Desconectado/a
se unió: 03/03/2016

-b, --backup
With this option, preexisting destination files are renamed as
each file is transferred or deleted. You can control where the
backup file goes and what (if any) suffix gets appended using
the --backup-dir and --suffix options.

-From the man page for rsync

I think this just renames a copy of each destination file so they don't get overwritten by mistake. If you have ever used Windows and download something more than once you get:
file file(1) file(2) file(3)

Or, using emacs it makes backups with ~ :
file file~

But it is important that you RTFM or STFW or you may lose your data! Have you used this program before? Why do you want to use this option?

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

Any reason you want to use 'grsync'? Trisquel has an excellent backup utility (in "System settings"), which uses duplicity as a backend:

  • incremental backup (only backup files that are new or were modified);
  • compressed backup (faster and save space);
  • integrated with the file manager (you revert to any previous version of the file/folder in about three clicks);
  • periodic backup (or a notification if the external drive is not plugged);
  • the oldest versions of the files are automatically removed if space is missing;
  • very easy to use (choose where to backup and then use the graphical utility with two buttons: "backup" and "restore");
  • possible encryption;
  • ...
GNUbahn
Desconectado/a
se unió: 02/19/2016

I've used grsync several times and it works fine. I was just wondering what the 'make backup' option would do for me. I use grsync to make an exact copy of my folders, files and structure. One advantage of this is, that I can find any single file this way, without doing a full restore data session.

Is that possible when backing up using Trisquels build in backup software?

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

It is. Like I wrote, there even is an integration with the file manager. You can just right-lick on a file or in the white space of the window and, respectively, restore an older version or restore files that were deleted. The different dates when back-ups were made are then proposed in a drop-down menu.

Ra
Ra
Desconectado/a
se unió: 07/23/2014

This doesn't work with my computer, Trisquel mini with PCManFM. I can only restore entire backups, no single files. Neither in the backup-window, nor in the file manager. What can i do?

lembas
Desconectado/a
se unió: 05/13/2010

"If we wanted to restore just the file "Mail/article" in /home/me as it was three days ago into /home/me /restored_file:

duplicity -t 3D --file-to-restore Mail/article scp:name at domain/some_dir /home/me/restored_file"
--duplicity manual page

Ra
Ra
Desconectado/a
se unió: 07/23/2014

This is ridiculous, like in so many other man pages.
Is there a difference between scp and, like it says in my man page, sftp? Why would i need any of them anyway? What user ID on what other host, and why is there supposed to be a dot in the host name?
This is just about getting a file back from one hard disk to another! What is the sense of all this fuzz? It takes me a couple of minutes to copy my most important folders to another disk and there i can find any file in a very short time! Why should i learn commands for backing up or look them up each time i want to restore a file (which rarely is the case)?! Why can't the backup program simply show me the folder structure as it was copied and let me choose which folder/file to restore? Copying entire folders seems to be the easiest way to do backups, even for people who think they might once need an older version of a file.
By the way, my external hard disk has space characters in its name and i can't change the name, not even as root ("device is occupied"). So i can't access it via shell. Any suggestions?

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

What is the sense of all this fuzz? It takes me a couple of minutes to copy my most important folders to another disk and there i can find any file in a very short time!

If we are talking about a few hundreds of MB, periodically copying them with a crontab can be good enough. Problems arise with larger backups: efficiency problems, lack of space, etc. See https://trisquel.info/forum/buck-using-rsync#comment-96275

Why should i learn commands for backing up or look them up each time i want to restore a file (which rarely is the case)?!

You need not learn any command if you use GNOME's file manager. Otherwise the 'deja-dup' command (see my previous post below), which is far easier (but less flexible) than 'duplicity' (Déjà Dup's backend).

Why can't the backup program simply show me the folder structure as it was copied and let me choose which folder/file to restore?

The files are compressed to save space and time (compressing with GNU ZIP and writing the compressed file is faster than writing the large uncompressed file). And they are split in medium size pieces to optimize the transfer (I believe that too small means too much overhead, whereas too large means a lot to resend if the piece gets corrupted in the process).

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

I should have made it clear that I was talking about GNOME's file manager, by default in Trisquel. Not in Trisquel Mini.

The command line can be used but, clearly, its is not as user-friendly:
$ deja-dup --restore FILE1 FILE2
$ deja-dup --restore-missing DIRECTORY

pragmatist

I am a member!

Desconectado/a
se unió: 03/03/2016

"By the way, my external hard disk has space characters in its name and i can't change the name"

Do you mean that if you wanted the name to be "hard-disk-name" it is instead "hard disk name" ?

Where is the disk mounted? Type this in a terminal to find out:
df

Where are you, in what directory, when you change the name?

Ra
Ra
Desconectado/a
se unió: 07/23/2014

It is mounted in /dev/sdf1.
When i try to change the name i am in /media/ra, because i try to do it in the file manager. Is it impossible there?

pragmatist

I am a member!

Desconectado/a
se unió: 03/03/2016

When
you say, "change the name" are you referring to the mount point? When
you typed df and saw the mounted device is /dev/sdf1 it should also say
where it is mounted to, like:

Filesystem Mounted On
/dev/sdf1 /media/ra

If that is the situation, are you trying to change /media/ra to another
name? I don't know what you mean by 'change the name'

If you are trying to change the name of a directory you are using, you will have a problem. You need to unmount the device first (make sure you save whatever you need to save first!):
sudo umount /dev/sdf1 and change out of /media/ra:
cd
Now you can change /media/ra to a different name:
sudo mv /media/ra /media/name-you-want

Ra
Ra
Desconectado/a
se unió: 07/23/2014

You are right, i mistook the system name for the mount point. Mount point is: /media/ra/TOURO Mobile 3.0 (TOURO Mobile 3.0 ist the name i want to change, it's the name since i bought it).
I guess i can't change that path via shell, because the shell won't understand it due to the space characters. Right?
Strange though that the system recognizes a path with space characters.

pragmatist

I am a member!

Desconectado/a
se unió: 03/03/2016

"I guess i can't change that path via shell, because the shell won't understand it due to the space characters. Right?"

You have three choices--that I'm familiar with:

1.) You can either put the whole thing in quotes:
sudo mv "/media/ra/TOURO Mobile 3.0" /media/ra/new-name

2.) You can insert spaces by 'escaping them' with the backslash '\' For example, if the file was called "this is a file" you can write: this\ is\ a\ file Notice the backslash before each space. So we get:
sudo mv /media/ra/TOURO\ Mobile\ 3.0 /media/ra/new-name

3.) You can use auto-completion (usually the easiest):
sudo mv /media/ra/TOU and if now you hit the TAB key you will see:
/media/ra/TOURO\ Mobile\ 3.0

So really there are two approaches. Either put it all in " or escape the spaces with backslashes \
The difference between choice 2 and 3 is that you let auto-completion type the whole mess instead of you! This is especially useful if you are manipulating long files like:
i3wm - How To 'Rice' Your Desktop (3_3)-ARKIwOlazKI.webm

I just type i3 hit TAB and that is it.

Escaping with backslashes is also for other unusual characters. But why type all of that if you don't have to.

Edit: You don't have to type "TOU" before you hit TAB. it just depends on what else is in the directory. If nothing else begins with a 'T' you can just type T and then TAB

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

Single quotes can be used too. The difference with double quotes mostly matters to people writing Shell scripts (inside single quotes, *nothing* is interpreted; inside double quotes $ and backquotes are interpreted).

But yes, auto-completion is the fastest.

I believe it is possible to actually change the name (the original question). E.g., through "Disks" in the "System Settings": select the disk, the partition, click the icon below with two gears, choose "Edit Partition..." (or is it "Edit Filesystem..."?) and define a name/label.