https://wiki.archlinux.org/api.php?action=feedcontributions&user=Equant&feedformat=atomArchWiki - User contributions [en]2024-03-28T16:30:52ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Sync_laptop_desktop&diff=390014Sync laptop desktop2015-08-04T21:17:48Z<p>Equant: Unison must be the same version. This is value to know before you choose this method.</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[fr:Synchroniser vos ordinateurs]]<br />
{{Expansion}}<br />
{{Poor writing|first person}}<br />
It is not always possible to copy one computer's drive to the other. For example, some files must differ on both machines, or respective updates do not match.<br />
<br />
==Unison==<br />
<br />
[http://www.cis.upenn.edu/~bcpierce/unison/ Unison]. <br />
[http://caml.inria.fr/about/successes-images/unison.jpg Screenshot].<br />
<br />
You need to have ssh on both machines, and (the same version of) unison installed on both <br />
machines (your laptop and desktop). Then with a few simple commands you <br />
can synchronise directories, and in a GUI you can select which things <br />
you wish to have synchronised and which not. You can also resolve <br />
conflicts.<br />
<br />
'''~/.unison/electra.prf''' (laptop)<br />
root = /home/hugo<br />
<nowiki>root = ssh://pyros//home/hugo</nowiki><br />
follow = Path school<br />
include common<br />
<br />
'''~/.unison/pyros.prf''' (desktop)<br />
root = /home/hugo<br />
<nowiki>root = ssh://electra//home/hugo</nowiki><br />
follow = Path school<br />
include common<br />
<br />
'''~/.unison/common'''<br />
ignore = Regex .*(cache|Cache|te?mp|history|thumbnails).*<br />
ignore = Name sylpheed.log*<br />
ignore = Name unison.log<br />
ignore = Name .ICEauthority<br />
ignore = Name .Xauthority<br />
ignore = Path {.songinfo,.radinfo}<br />
ignore = Path .adesklets<br />
ignore = Path .Azureus<br />
ignore = Path .forward<br />
ignore = Path adesklets<br />
ignore = Path .ethereal<br />
ignore = Path .sheep<br />
ignore = Path .xinitrc<br />
ignore = Path .config<br />
ignore = Path .xscreensaver<br />
ignore = Path .xawtv<br />
ignore = Path .radio<br />
ignore = Path .forward<br />
ignore = Path .dc++<br />
ignore = Path .quodlibet<br />
ignore = Path .tvtime<br />
ignore = Path .config/graveman<br />
ignore = Path .xmodmap<br />
ignore = Path .java<br />
ignore = Path .tvlist*<br />
ignore = Path .thumbnails<br />
ignore = Path .ssh<br />
ignore = Path .viminfo<br />
ignore = Path .vim/tmp<br />
ignore = Path Desktop<br />
ignore = Path .wine*<br />
ignore = Path motion<br />
ignore = Path src/ufobot/test_pipe<br />
ignore = Path tmp<br />
ignore = Path local<br />
ignore = Path books<br />
ignore = Path .mozilla/firefox/*/Cache*<br />
ignore = Path .liferea/cache<br />
ignore = Path .liferea/mozilla/liferea/Cache<br />
ignore = Path .sylpheed-*/*.bak<br />
ignore = Path .sylpheed-*/folderlist.xml*<br />
ignore = Path .liferea/new_subscription<br />
ignore = Path .mozilla/firefox/pluginreg.dat<br />
ignore = Path .mozilla/firefox/*/lock<br />
ignore = Path .mozilla/firefox/*/XUL.mfasl<br />
ignore = Path .mozilla/firefox/*/xpti.dat<br />
ignore = Path .mozilla/firefox/*/cookies.txt<br />
ignore = Path .xbindkeysrc<br />
ignore = Path .unison/ar*<br />
ignore = Path .gaim/icons<br />
ignore = Path .gaim/blist.xml<br />
ignore = Path .asoundrc<br />
ignore = Path .maillog<br />
ignore = Path .openoffice2/.lock<br />
<br />
As you can see, there are two different profiles, one for running from <br />
the laptop, and one for running the desktop. Files are posted <br />
here as example, they are nowhere essential for your configuration.<br />
<br />
Bash aliases were created for quick usage. One example is:<br />
<br />
alias unisync="unison-gtk2 electra -contactquietly -logfile /dev/null"<br />
<br />
This starts unisync using profile 'electra', for when running the<br />
laptop.<br />
<br />
A line in ~/Desktop/autostart automates the process when wanting to sync desktop with laptop:<br />
<br />
xterm -e 'ping -q -W 2 -c 2 pyros &&<br />
unison-gtk2 electra -contactquietly -logfile /dev/null &&<br />
gxmessage -buttons no:0,yes:1 Syncing done. Shutdown pyros? ||<br />
ssh pyros sudo halt' &<br />
<br />
=== Limitations ===<br />
<br />
You can also use this tool with NFS shares, but you may find that it is <br />
slower, because using the ssh solution it asks the other side to check <br />
for updates, and thus not requiring network traffic for that part of the syncing process.<br />
<br />
If you are using a ssh port different from the default (22), <br />
for example 1022, use this line in your prf file: <br />
sshargs = -p 1022<br />
<br />
If you are using symbolic links and want to synchronise your files on a <br />
vfat system (usb key for example), unison will not accept them and <br />
generate errors. You cannot just tell unison you do not want symbolic <br />
links, you have to name them all. To find them on your system, you can <br />
run <br />
find ~/folder -type l<br />
<br />
== rsync ==<br />
<br />
See [[rsync]]<br />
<br />
== rdiff-backup ==<br />
<br />
The following tool was used with the following backup script:<br />
<br />
#!/bin/sh<br />
<br />
mount /bak<br />
#mount /boot<br />
mount /mnt/win<br />
<br />
rdiff-backup \<br />
--exclude-regexp 'cache$' \<br />
--exclude-regexp '(?i)/te?mp$' \<br />
--exclude /mnt \<br />
--exclude /vol \<br />
--exclude /bak \<br />
--exclude /usr/media \<br />
--exclude /usr/media/misc \<br />
--exclude /usr/lib \<br />
--exclude /tmp \<br />
--exclude /var/dl \<br />
--exclude /var/spool \<br />
--exclude /var/cache \<br />
--exclude /proc \<br />
--exclude /dev \<br />
--exclude /sys \<br />
/ /bak/sys<br />
<br />
echo "----------------------------------------"<br />
echo " * Listing increments of backup"<br />
echo "----------------------------------------"<br />
rdiff-backup --list-increments /bak/sys<br />
<br />
echo ""<br />
echo "----------------------------------------"<br />
echo " * Removing backups older than 5 Weeks"<br />
echo "----------------------------------------"<br />
rdiff-backup --force --remove-older-than 5W /bak/sys<br />
<br />
##Force is necessary because:<br />
#Fatal Error: Found 2 relevant increments, dated:<br />
#Sat Apr 10 12:39:24 2004<br />
#Sat Apr 17 04:15:01 2004<br />
#If you want to delete multiple increments in this way, use the --force.<br />
<br />
echo ""<br />
echo "----------------------------------------"<br />
echo " * Disk usage after backup"<br />
echo "----------------------------------------"<br />
df -h<br />
<br />
umount /bak<br />
#umount /boot<br />
umount /mnt/win</div>Equanthttps://wiki.archlinux.org/index.php?title=KEYMAP&diff=227424KEYMAP2012-10-07T16:05:26Z<p>Equant: </p>
<hr />
<div>[[Category:Internationalization]]<br />
[[es:KEYMAP]]<br />
[[pt:KEYMAP]]<br />
[[tr:Klavye_düzeni]]<br />
[[zh-CN:KEYMAP]]<br />
The '''KEYMAP''' variable is specified in the [[Systemd#Console_and_keymap|{{ic|/etc/vconsole.conf}}]] file ({{ic|/etc/rc.conf}} using the legacy rc.conf format). It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the {{Pkg|kbd}} package.<br />
<br />
==Keyboard layouts==<br />
This is the list of known keymap settings to work for the corresponding keyboard layouts. Usually the "map.gz" extension can be ignored.<br />
Most keymaps can be found in the {{ic|/usr/share/kbd/keymaps/i386/''layout''}} (''layout''=qwerty, azerty, dvorak, etc.) directory.<br />
<br />
Less common but nonetheless useful keymaps for Arch Linux are found in the {{ic|/usr/share/kbd/keymaps/''architecture''}} (''architecture''=mac, sun, etc.) directory.<br />
<br />
{{Note|In an X session, you can use setxkbmap to instantly apply keyboard layout: {{Ic|setxkbmap -layout dvorak}}}}<br />
<br />
{{Note|If these keymaps do not work for you, try removing the {{Ic|.map.gz}} from the keymap name. If that does not work, make sure the keymap file exists in {{ic|/usr/share/kbd/keymaps/}} using {{Ic|find}}: {{Ic|find /usr/share/kbd/keymaps/ -name "*[your desired keymap]*"}}}}<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Keyboard<br />
! Keymap setting<br />
|-<br />
|Belgian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"be-latin1.map.gz"}}<br />
|-<br />
|Brazilian Portuguese<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"br-abnt2.map.gz"}}<br />
|-<br />
|Canadian-French<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"cf.map.gz"}}<br />
|-<br />
|Canadian Multilingual (''in [[Arch User Repository|AUR]]'') <br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"ca_multi.map.gz"}}<br />
|-<br />
|Colemak ''(US)''<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"colemak"}}<br />
|-<br />
|Croatian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"croat.map.gz"}}<br />
|-<br />
|Czech<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"cz-lat2.map.gz"}}<br />
|-<br />
|Dvorak<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"dvorak"}}<br />
|-<br />
|French<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"fr-latin9.map.gz"}}<br />
|-<br />
|German<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"de-latin1.map.gz"}}<br />
|-<br />
|German ''(no dead keys)''<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"de-latin1-nodeadkeys.map.gz"}}<br />
|-<br />
|Italian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"it.map.gz"}}<br />
|-<br />
|Lithuanian ''(qwerty)''<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"lt.baltic.map.gz"}}<br />
|-<br />
|Norwegian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"no-latin1.map.gz"}}<br />
|-<br />
|Polish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"pl.map.gz"}}<br />
|-<br />
|Portuguese<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"pt-latin9.map.gz"}}<br />
|-<br />
|Romanian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"ro_win.map.gz"}}<br />
|-<br />
|Russian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"ru4.map.gz"}}<br />
|-<br />
|Singapore<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"sg-latin1.map.gz"}}<br />
|-<br />
|Slovene<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"slovene"}}<br />
|-<br />
|Swedish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"sv-latin1.map.gz"}}<br />
|-<br />
|Swiss-French<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"fr_CH-latin1.map.gz"}}<br />
|-<br />
|Swiss-German<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"de_CH-latin1.map.gz"}}<br />
|-<br />
|Spanish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"es.map.gz"}}<br />
|-<br />
|Spanish Latinoamerican<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"la-latin1.map.gz"}}<br />
|-<br />
|Turkish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"tr_q-latin5.map.gz"}}<br />
|-<br />
|Ukrainian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"ua.map.gz"}}<br />
|-<br />
|United Kingdom<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>"uk"}}<br />
|}<br />
<br />
==Configuring the Console Keymap==<br />
<br />
#{{ic|cd}} to {{ic|/usr/share/kbd/keymaps/i386/qwerty}}<br />
#Copy your default keymap ({{ic|us.map.gz}}) to a new file {{ic|personal.map.gz}}<br />
#{{ic|gunzip}} the new map file<br />
#Edit {{ic|personal.map}} using your favorite editor. Examples:<br />
#*'''Make the Right Alt key same as Left Alt key (Emacs)'''<br>change the line {{ic|include "linux-with-alt-and-altgr"}} to {{ic|include "linux-with-two-alt-keys"}}<br />
#*'''Swap CapsLock with Escape (Vim)'''<br>make {{ic|keycode 1 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Escape}}<br />
#*'''Make CapsLock another Control key'''<br>change the line {{ic|keycode 58 <nowiki>=</nowiki> Caps_Lock}} to {{ic|keycode 58 <nowiki>=</nowiki> Control}}<br />
#*'''Swap CapsLock with Left Control key'''<br>make {{ic|keycode 29 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Control}}<br />
#{{ic|gzip}} the map file<br />
#Change the default keyboard layout file that will be used by editing {{ic|/etc/vconsole.conf}} (you might have to create this file) and changing the line that says {{ic|KEYMAP<nowiki>=</nowiki>us}} to {{ic|KEYMAP<nowiki>=</nowiki>personal}}<br />
#Reboot to use your keymap the way nature intended (or run "loadkeys personal")<br />
{{Note| Prior to using {{ic|/etc/vconsole.conf}}, {{ic|KEYMAP<nowiki>=</nowiki>us}} was declared in {{ic|/etc/rc.conf}}.}}</div>Equant