https://wiki.archlinux.org/api.php?action=feedcontributions&user=Chionsas&feedformat=atomArchWiki - User contributions [en]2024-03-28T12:27:41ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Internet_sharing&diff=263087Internet sharing2013-06-17T12:16:52Z<p>Chionsas: Added OpenDNS and IPv6 addresses to free dns server choices.</p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:Internet Share]]<br />
[[es:Conexion a Internet compartida]]<br />
[[fr:Partage de connexion]]<br />
[[it:Internet Share]]<br />
[[ru:Internet Share]]<br />
This article explains how to share the internet connection from one machine to other(s).<br />
<br />
==Requirements==<br />
* The machine acting as server should have an additional network device<br />
* That network device should be connected to the machines that are going to receive internet access. They can be one or more machines. To be able to share internet to several machines a [[Wikipedia:Network switch|switch]] is required. If you are sharing to only one machine, a [[Wikipedia:Ethernet crossover cable|crossover cable]] is sufficient<br />
{{Note|If one of the two computers has a gigabit ethernet card, a crossover cable is not necessary and a regular ethernet cable should be enough}}<br />
<br />
==Configuration==<br />
Using [[Udev#Setting static device names]], name the network device connected to the other computer(s) as '''''net0''''' and the network device connected to the internet as '''''internet0'''''.<br />
===Static IP address===<br />
Assign an static IPv4 address to the interface connected to the other machines. The first 3 bytes of this address cannot be exactly the same as those of another interface.<br />
{{bc|<br />
# ip link set up dev net0<br />
# ip addr add 139.96.30.100/24 dev net0 # arbitrary address<br />
}}<br />
To have your static ip assigned at boot, you can use [[netcfg]].<br />
<br />
===Enable packet forwarding===<br />
Enter this command to temporaly enable packet forwarding:<br />
{{bc|<nowiki>sysctl net.ipv4.ip_forward=1</nowiki>}}<br />
Edit {{ic|/etc/sysctl.conf}} and add this line, which will make the previous change persistent after a reboot.<br />
{{bc|<nowiki>net.ipv4.ip_forward=1</nowiki>}}<br />
If you are using ipv6, use these lines:<br />
{{bc|<nowiki><br />
net.ipv6.conf.default.forwarding=1<br />
net.ipv6.conf.all.forwarding=1<br />
</nowiki>}}<br />
===Enable NAT===<br />
[[pacman|Install]] the package {{Pkg|iptables}} from the [[Official Repositories|official repositories]].<br />
Use iptables to enable NAT:{{bc|<nowiki><br />
# iptables -t nat -A POSTROUTING -o internet0 -j MASQUERADE<br />
# iptables-save > /etc/iptables/iptables.rules<br />
# systemctl start iptables<br />
</nowiki>}}{{Note| Of course, this also works with a mobile broadband connection (usually called ppp0 on PC1)}}<br />
You can set {{ic|iptables.service}} to [[Daemon|auto start a boot]].<br />
<br />
Read the [[iptables]] article for more information.<br />
<br />
===Assigning ip addresses to the client pc(s)===<br />
If you are planning to regularly have several machines using the internet shared by this machine, then is a good idea to install a [[Wikipedia:dhcp|dhcp server]].<br />
<br />
You can read the [[dhcpd]] wiki article, to add a dhcp server. Then, install the [[dhcpcd]] client on every client pc.<br />
<br />
If you are not planing to use this setup regularly, you can manually add an ip to each client instead.<br />
====Manually adding an ip====<br />
<br />
Instead of using dhcp, on each client pc, add an ip address and the default route:<br />
{{bc|<nowiki><br />
ip addr add 139.96.30.120/24 dev eth0<br />
ip link set up dev eth0<br />
ip route add default via 139.96.30.100 dev eth0<br />
</nowiki>}}<br />
Add a nameserver:<br />
{{bc|<nowiki><br />
echo "nameserver <nameserver ip>" >> /etc/resolv.conf<br />
</nowiki>}}<br />
<br />
You can figure out the address of the nameserver by looking into the {{ic|/etc/resolv.conf}} of the server, if its Internet connection is already established.<br />
<br />
If you don't have a nameserver, you can use any of the free public DNS servers, which are relatively fast:<br />
* [https://code.google.com/speed/public-dns/ Google Public DNS]<br />
** 8.8.8.8<br />
** 8.8.4.4<br />
** [2001:4860:4860::8888]<br />
** [2001:4860:4860::8844]<br />
* [https://opendns.com OpenDNS]:<br />
** 208.67.222.222<br />
** 208.67.220.220<br />
** [2620:0:ccc::2]<br />
** [2620:0:ccd::2]<br />
<br />
Bracket notation must be used for IPv6 addresses in resolv.conf.<br />
<br />
That's it. The client PC should now have Internet.<br />
<br />
== Troubleshooting ==<br />
<br />
If you are able to connect the two PCs but cannot send data (for example, if the client PC makes a DHCP request to the server PC, the server PC receives the request and offers an IP to the client, but the client does not accept it, timing out instead), check that you don't have other [[Iptables]] rules [https://bbs.archlinux.org/viewtopic.php?pid=1093208 interfering].<br />
<br />
==See also==<br />
*[[Sharing ppp connection with wlan interface]]<br />
*[[Simple stateful firewall]]<br />
*[[Router]]<br />
*[[USB 3G Modem]]</div>Chionsashttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=259404Synchronization and backup programs2013-05-28T20:06:20Z<p>Chionsas: Added a closed-source point to Symform's description.</p>
<hr />
<div>[[Category:Data compression and archiving]]<br />
[[Category:System recovery]]<br />
[[ru:Backup Programs]]<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files ({{Ic|/etc/*}}) and the local pacman database (usually {{Ic|/var/lib/pacman/local/*}}).<br />
<br />
== Introduction ==<br />
Before you start trying various programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available? (CD, DVD, remote server, external hard drive, etc.)<br />
* How often do I plan to backup? (daily, weekly, monthly, etc.)<br />
* What features do I expect from the backup solution? (compression, encryption, handles renames, etc.)<br />
* How do I plan to restore backups if needed?<br />
<br />
== Incremental backups ==<br />
Applications that can do incremental backups remember and take into account what data has been backed up during the last run and eliminate the need to have duplicates of unchanged data. Restoring the data to a certain point in time would require locating the last full backup and all the incremental backups from then to the moment when it is supposed to be restored. This sort of backup is useful for those who do it very often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe how the contents of files and folders changed from the last backup (so-called 'diffs'). Hence, they are inherently incremental, but usually they do not have compression or encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. A downside to rsync-type programs is that they cannot be easily burned and restored from a CD or DVD.<br />
<br />
==== Console ====<br />
* {{App|[[rsync]]|A file transfer program to keep remote files in sync.<br />
** rsync almost always makes a mirror of the source.<br />
** Impossible to restore a full backup before the most recent backup (but you can use --backup to keep old versions of the files).<br />
** Standard install on all distros.<br />
** Can run over SSH (port 22) or native rsync protocol (port 873).<br />
** Win32 version available.<br />
|http://rsync.samba.org/|{{Pkg|rsync}}}}<br />
<br />
* {{App|[[Wikipedia:Rsync#Variations|rdiff-backup]]|A utility for local/remote mirroring and incremental backups.<br />
** Stores the most recent backup as regular files.<br />
** To revert to older versions, you apply the diff files to recreate the older versions.<br />
** It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change.<br />
** Win32 version available.<br />
|http://www.nongnu.org/rdiff-backup/|{{Pkg|rdiff-backup}}}}<br />
<br />
* {{App|[[rsnapshot]]|A remote filesystem snapshot utility.<br />
** Does not store diffs, instead it copies entire files if they have changed.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
** Destination filesystem must support hard links.<br />
** Win32 version available.<br />
|http://www.rsnapshot.org/|{{Pkg|rsnapshot}}}}<br />
<br />
* {{App|SafeKeep|A client/server backup system which uses rdiff-backup.<br />
** Integrates with Linux LVM and databases to create consistent backups.<br />
** Bandwidth throttling.<br />
|http://safekeep.sourceforge.net/|{{AUR|safekeep}}}}<br />
<br />
* {{App|Link-Backup|A tool similar to rsync based scripts, but which does not use rsync.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer.<br />
** The backup directory contains {{ic|.catalog}}, a catalog of all unique file instances; backup trees hard-link to this catalog.<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script.<br />
** It copies itself to the server; it does not need to be installed on the server.<br />
** Requires SSH for remote backups.<br />
** It resumes stopped backups; it can even be told to run for an arbitrary number of minutes.<br />
|http://www.scottlu.com/Content/Link-Backup.html|{{AUR|link-backup}}}}<br />
<br />
* {{App|[[Wikipedia:Unison (file synchronizer)|Unison]]|A program that synchronizes files between two machines over network (LAN or Inet) using a smart diff method + rsync. Allows the user to interactively choose which changes to push, pull, or merge.|http://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
<br />
* {{App|oldtime|A highly customizable and configurable backup & restore system.|https://github.com/GutenYe/oldtime|{{AUR?|oldtime}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Back In Time|A simple backup tool for Linux inspired by the [[Wikipedia:FlyBack|FlyBack]] and [https://wiki.ubuntu.com/TimeVault/ TimeVault] projects.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Really is just a front-end to {{ic|rsync}}, {{ic|diff}}, {{ic|cp}}.<br />
** A new snapshot is created only if something changed since the last snapshot.<br />
|http://backintime.le-web.org/|{{AUR|backintime}}}}<br />
<br />
* {{App|[[Wikipedia:FlyBack|FlyBack]]|A clone of Apple's [[Wikipedia:Time Machine (Mac OS)|Time Machine]], a backup utility for Mac OS X.|http://www.flyback-project.org/|{{AUR|flyback}}}}<br />
<br />
* {{App|[[Wikipedia:Areca Backup|Areca Backup]]|An easy to use and reliable backup solution for Linux and Windows.<br />
** Written in Java.<br />
** Primarily archive-based (zip), but will do file-based backup as well.<br />
** Delta backup supported (stores only changes).<br />
|http://areca.sourceforge.net/|{{AUR|areca}}}}<br />
<br />
* {{App|[[Wikipedia:LuckyBackup|luckyBackup]]|An easy program to backup and sync your files.<br />
** It is written in Qt and C++.<br />
** It has sync, backup (with include and exclude options) and restore capabilities.<br />
** It can do remote connection backups, scheduled backups.<br />
** A command line mode.<br />
|http://luckybackup.sourceforge.net/index.html|{{AUR|luckybackup}}}}<br />
<br />
* {{App|syncBackup|A front-end for rsync that provides a fast and extraordinary copying tool. It offers the most common options that control its behavior and permit very flexible specification of the set of files to be copied.<br />
|http://www.darhon.com/syncbackup|{{AUR|syncbackup}}}}<br />
<br />
* {{App|[[BackupPC]]|A high-performance, enterprise-grade system for backing up Unix, Linux, Windows, and Mac OS X desktops and laptops to a remote server.<br />
** Deduplication: Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.<br />
** Optional compression support further reducing disk storage.<br />
** No client-side software is needed.<br />
** Simple but powerful web-based UI.<br />
|http://backuppc.sourceforge.net/index.html|{{Pkg|backuppc}}}}<br />
<br />
=== Other backups ===<br />
Most other backup applications tend to create (big) archive files and (of course) keep track of what's been archived. Creating {{ic|.tar.bz2}} or {{ic|.tar.gz}} archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you do not need to have the backup program around.<br />
<br />
==== Console ====<br />
* {{App|Arch Backup|A trivial backup script with simple configuration.<br />
** Configurable compression method.<br />
** Multiple backup targets.<br />
|http://code.google.com/p/archlinux-stuff/|{{Pkg|arch-backup}}}}<br />
<br />
* {{App|[[Backup with hdup|hdup]]|A very simple command line backup tool.<br />
** Creates tar.gz or tar.bz2 archives.<br />
** Supports gpg encryption.<br />
** Supports pushing over SSH.<br />
** Multiple backup targets.<br />
|http://miek.nl/projects/hdup2/|{{AUR|hdup}}}}<br />
<br />
* {{App|rdup|A platform for backups that provides scripts to facilitate backups and delegates the encryption, compression, transfer and packaging to other utilities in a true Unix-way.<br />
** Creates tar.gz archives or rsync-type copy.<br />
** Encryption (gpg, blowfish and others); also applies for rsync-type copy.<br />
** Compression (also for rsync-type copy).<br />
|http://miek.nl/projects/rdup|{{AUR|rdup}}}}<br />
<br />
* {{App|[[Duplicity]]|A simple command-line utility which allows encrypted compressed incremental backup to nearly any storage.<br />
** Supports gpg encryption and signing.<br />
** Supports gzip compression.<br />
** Supports full or incremental backups, incremental backup stores only difference between new and old file.<br />
** Supports pushing over FTP, SSH, rsync, WebDAV, WebDAVs, HSi and Amazon S3 or local filesystem.<br />
|http://www.nongnu.org/duplicity/|{{Pkg|duplicity}}}}<br />
<br />
* {{App|[[Wikipedia:DAR (Disk Archiver)|DAR]]|A full-featured command-line backup tool, short for Disk ARchive.<br />
** It uses its own format for archives (so you need to have it around when you want to restore).<br />
** Supports splitting backups into more files by size.<br />
** Makefile-type config files, some custom scripts are available along with it.<br />
** Supports basic encryption.<br />
** Automatic backup using [[cron]] is possible with {{AUR|sarab}}.<br />
|http://dar.linux.free.fr/|{{AUR|dar}} {{AUR|kdar}} (fontend)}}<br />
<br />
* {{App|Manent|An algorithmically strong backup and archival program. NOTE: no upstream activity since 2009.<br />
** Efficient backup to anything that looks like a storage.<br />
** Works well over a slow and unreliable network.<br />
** Offers online access to the contents of the backup.<br />
** Backed up storage is completely encrypted.<br />
** Several computers can use the same storage for backup, automatically sharing data.<br />
** Not reliant on timestamps of the remote system to detect changes.<br />
** Cross-platform support for Unicode file names.<br />
|http://code.google.com/p/manent/|{{AUR|manent}}}}<br />
<br />
* {{App|btar|tar-compatible archiver<br />
** Fast archive creation (multicore compression or ciphering)<br />
** Arbitrary chain of compression/ciphers (calls any compression/ciphering programs)<br />
** Indexed archive retrieval or listing<br />
** Redundancy<br />
** Serialization through pipes (and only one file per backup)<br />
** Can be extracted or checked with gnutar<br />
** Differential backups of multiple levels<br />
** Optional encoding of big files with rsync-differences<br />
|http://viric.name/cgi-bin/btar|{{AUR|btar}}}}<br />
<br />
* {{App|obnam|Easy, secure backup program<br />
** Uses snapshots instead of full/incremental backups<br />
|http://liw.fi/obnam/|{{AUR|obnam}}}}<br />
<br />
* {{App|System Tar & Restore|A set of bash scripts for full system backup and restore<br />
** CLI and Dialog interfaces, Zenity wrappers<br />
** Easy backup and restore wizards<br />
** Uses tar to create and restore backups<br />
** Creates tar.gz or tar.xz archives<br />
** Uses rsync to transfer a running system<br />
** Supports Grub2 and Syslinux<br />
|http://code.google.com/p/system-tar-and-restore/|{{AUR|system-tar-and-restore}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Backerupper|A simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** Creates {{ic|.tar.gz}} archives.<br />
** Configurable backup frequency, backup time and max copies.<br />
|http://sourceforge.net/projects/backerupper/|{{AUR|backerupper}}}}<br />
<br />
* {{App|[[Duplicity|Déjà Dup]]|A simple GTK+ backup program. It hides the complexity of doing backups the 'right way' (encrypted, off-site, and regular) and uses duplicity as the backend.<br />
** Automatic, timed backup configurable in GUI.<br />
** Restore wizard.<br />
** Integrated into the Nautilus file manager.<br />
** Inherits several features of duplicity.<br />
|https://launchpad.net/deja-dup|{{Pkg|deja-dup|}}}}<br />
<br />
* {{App|Synkron|A folder synchronization tool.<br />
** Syncs multiple folders.<br />
** Can exclude files from sync based on wildcards.<br />
** Restores files.<br />
** Cross-platform support.<br />
|http://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
<br />
== Cloud backups ==<br />
* {{App|[[Wikipedia:CrashPlan|CrashPlan]]|An online/offsite backup solution.<br />
** Unlimited online space for very reasonable pricing.<br />
** Automatic and incremental backups to multiple destinations.<br />
** Intuitive GUI.<br />
** Offers encryption and de-duplication.<br />
** Software is generally free.<br />
|http://www.crashplan.com/|{{AUR|crashplan}}}}<br />
<br />
* {{App|[[Dropbox]]|A popular file-sharing service.<br />
** A daemon monitors a specified directory, and uploads incremental changes to dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
|http://www.getdropbox.com|{{AUR|dropbox}} {{AUR|nautilus-dropbox}}}}<br />
<br />
* {{App|[[Wikipedia:Jungle Disk|Jungle Disk]]|An online backup tool that stores its data in Amazon S3 or Rackspace Cloud Files.<br />
** A Nautilus extension.<br />
** Only paid plans available.<br />
|http://www.jungledisk.com/|{{AUR|nautilus-jungledisk}}}}<br />
<br />
* {{App|Tarsnap|A secure online backup service for BSD, Linux, OS X, Solaris and Windows (through Cygwin).<br />
** Compressed encrypted backups to Amazon S3 Servers.<br />
** Automate via [[cron]].<br />
** Incremental backups.<br />
** Backup any files or directories.<br />
** Command line only client.<br />
** Pay only for usage (bandwidth and storage). <br />
|http://www.tarsnap.com|{{Pkg|tarsnap}}}}<br />
<br />
* {{App|[[Wikipedia:Wuala|Wuala]]|A secure online storage, file synchronization, versioning and backup service.<br />
** Closed source, free and paid version available.<br />
** Free account holds 5GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
** Social networking features.<br />
** All files in the cloud are first encrypted locally.<br />
|http://www.wuala.com/|{{AUR|wuala}}, {{AUR|wuala-daemon}} &ndash; to run as daemon}}<br />
<br />
* {{App|[[Wikipedia:SpiderOak|SpiderOak]]|An online backup tool for Windows, Mac and Linux users to back up, share, sync, access and store[1] their data.<br />
** Free and paid version available.<br />
** Free account holds 2GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
|https://spideroak.com/|{{AUR|spideroak}}}}<br />
<br />
* {{App|[[Ubuntu One]]|An online storage service with sync and sharing across platforms.<br />
** Free and payed versions available.<br />
** Free account with 5GB.<br />
** Mobile access.<br />
** Music streaming.<br />
|https://one.ubuntu.com/services/|{{Pkg|ubuntuone-client}}}}<br />
<br />
* {{App|Packrat|A simple, modular backup system that uses [[Wikipedia:DAR (Disk Archiver)|DAR]] to take full or incremental backups of files and can store them locally, on a remote system via SSH, or on Amazon S3.|http://www.zeroflux.org/projects|{{AUR|packrat}}}}<br />
<br />
== Cooperative storage cloud backups ==<br />
<br />
A [[Wikipedia:Cooperative_storage_cloud|cooperative storage cloud]] is a decentralized model of networked online storage where data is stored on multiple computers, hosted by the participants cooperating in the cloud. <br />
<br />
* {{App|[http://www.symform.com Symform]| A peer-to-peer cloud backup service.<br />
** Unlimited free backup in exchange for 2:1 storage space contribution with an always-connected device (at least 80% uptime).<br />
** [http://www.symform.com/our-solutions/pricing/ Payment options exist].<br />
** First 10GB of backup storage is free (no contribution needed).<br />
** In addition to paid support, support plans in exchange for extended contribution (300GB+) exist.<br />
** Automatic and incremental backups.<br />
** Data is encrypted before leaving the computer, though keys are also stored on the Symform's servers.<br />
** Customizable limits for bandwidth consumption.<br />
** Ability to have a local copy ("Hot Copy") of the backed up data on a different disk or computer.<br />
** Ability to have synchronized folders between nodes (Dropbox-like).<br />
** Closed source, using mono. Windows clients available.<br />
|http://www.symform.com/|{{AUR|symform}}}}<br />
<br />
== Non-incremental backups ==<br />
Another type of backups are those used in case of a disaster. These include application that allow easy backup of entire filesystems and recovery in case of failure, usually in the form of a Live CD or USB drive. The contains complete system images from one or more specific points in time and are frequently used by to record known good configurations.<br />
<br />
* {{App|Q7Z|P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar.<br />
** Updates existing archives quickly.<br />
** Backup multiple folders to a storage location.<br />
** Create or extract protected archives.<br />
** Lessen effort by using archiving profiles and lists.<br />
|http://k7z.sourceforge.net/|{{AUR|q7z}}}}<br />
<br />
* {{App|[[Partclone]]|A tool that can be used to back up and restore a partition while considering only used blocks.<br />
** Supports ext2, ext3, hfs+, reiser3.5, reiser3.6, reiser4, ext4 and btrfs.<br />
** Supports compression.<br />
|http://partclone.nchc.org.tw/trac/|{{AUR|partclone}}}}<br />
<br />
* {{App|[[Wikipedia:Redo Backup and Recovery|Redo Backup and Recovery]]|A backup and disaster recovery application that runs from a bootable Linux CD image.<br />
** Is capable of bare-metal backup and recovery of disk partitions.<br />
** Uses [http://www.xpud.org/ xPUD] and [[Partclone]] for the backend.<br />
|http://www.redobackup.org/|{{AUR?|redobackup}}}}<br />
<br />
* {{App|[[Wikipedia:Clonezilla|Clonezilla]]|A disaster recovery, disk cloning, disk imaging and deployment solution.<br />
** Boots from live CD, USB flash drive, or PXE server.<br />
** Supports ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs, btrfs FAT32, NTFS, HFS+ and others.<br />
** Uses Partclone (default), Partimage (optional), ntfsclone (optional), or dd to image or clone a partition.<br />
** Multicasting server to restore to many machines at once.<br />
|http://clonezilla.org/|{{AUR|clonezilla}}}}<br />
<br />
* {{App|[[Wikipedia:Partimage|Partimage]]|A disk cloning utility for Linux/UNIX environments.<br />
** Has a Live CD.<br />
** Supports the most popular filesystems on Linux, Windows and Mac OS.<br />
** Compression.<br />
** Saving to multiple CDs or DVDs or across a network using Samba/NFS.<br />
|http://www.partimage.org/Main_Page|{{Pkg|partimage}}}}<br />
<br />
* {{App|FSArchiver|A safe and flexible file-system backup and deployment tool<br />
** Support for basic file attributes (permissions, owner, ...).<br />
** Support for multiple file-systems per archive.<br />
** Support for extended attributes (they are used by SELinux).<br />
** Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems.<br />
** Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of a Windows partitions).<br />
** Checksumming of everything which is written in the archive (headers, data blocks, whole files).<br />
** Ability to restore an archive which is corrupt (it will just skip the current file).<br />
** Multi-threaded lzo, gzip, bzip2, lzma compression.<br />
** Support for splitting large archives into several files with a fixed maximum size.<br />
** Encryption of the archive using a password. Based on blowfish from libcrypto from [[OpenSSL]].<br />
** Support backup of a mounted root filesystem (-A option).<br />
|http://www.fsarchiver.org/Main_Page|{{Pkg|fsarchiver}}}}<br />
<br />
* {{App|[[Wikipedia:Mondo Rescue|Mondo Rescue]]|A disaster recovery solution to create backup media that can be used to redeploy the damaged system.<br />
** Image-based backups, supporting Linux/Windows.<br />
** Compression rate is adjustable.<br />
** Can backup live systems (without having to halt it).<br />
** Can split image over many files.<br />
** Supports booting to a Live CD to perform a full restore.<br />
** Can backup/restore over NFS, from CDs, tape drives and and other media.<br />
** Can verify backups.<br />
|http://www.mondorescue.org/|{{AUR|mondo}}}}<br />
<br />
== Versioning systems ==<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
=== Version control systems ===<br />
{{Wikipedia|Comparison of revision control software}}.<br />
<br />
* {{App|[[Git]]|A distributed revision control and source code management system with an emphasis on speed.<br />
** Very easy creation, merging, and deletion of branches.<br />
** Nearly all operations are performed locally, giving it a huge speed advantage on centralized systems.<br />
** Has a "staging area" or "index", this is an intermediate area where commits can be formatted and reviewed before completing the commit.<br />
** Does not handle binary files very well.<br />
|http://git-scm.com/|{{Pkg|git}}}}<br />
<br />
* {{App|[[Subversion]]|A full-featured centralized version control system originally designed to be a better CVS.<br />
** Renamed/copied/moved/removed files retain full revision history.<br />
** Native support for binary files, with space-efficient binary-diff storage.<br />
** Costs proportional to change size, not to data size.<br />
** Allows arbitrary metadata ("properties") to be attached to any file or directory. <br />
|http://subversion.apache.org/|{{Pkg|subversion}}}}<br />
<br />
* {{App|[[Mercurial]]|A distributed version control system written in Python and similar in many ways to Git.<br />
** Platform independent.<br />
** Support for [http://mercurial.selenic.com/wiki/UsingExtensions extensions].<br />
** A set of commands consistent with Subversion.<br />
** Supports tags.<br />
|http://mercurial.selenic.com/|{{Pkg|mercurial}}}}<br />
<br />
* {{App|[[Wikipedia:Bazaar (software)|Bazaar]]|A distributed version control system that helps you track project history over time and to collaborate easily with others.<br />
** Similar commands to Subversion.<br />
** Supports working with or without a central server.<br />
** Support for working with some other revision control systems<br />
** Complete Unicode support.<br />
|http://bazaar.canonical.com/en/|{{Pkg|bzr}}}}<br />
<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|A distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.<br />
** Offline mode.<br />
** Easy branching and merging.<br />
** Written in Haskell.<br />
** Not very fast.<br />
|http://darcs.net/|{{AUR|darcs}}}}<br />
<br />
=== VCS-based backups ===<br />
<br />
* {{App|Gibak|A backup system based on [[Git]].<br />
** Supports binary diffs.<br />
** Uses all of Git's features (such as {{ic|.gitignore}} for filtering files).<br />
** Uses Git's hook system to save information that Git does not (permissions, mtime, empty directories, etc).<br />
|https://github.com/pangloss/gibak|{{AUR|gibak}}}}<br />
* {{App|bup|A fledgling Git-based backup solution written in Python and C.<br />
** Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks.<br />
** Can back up directly to a remote bup server.<br />
** Has an improved index format to allow you to track many files.<br />
|https://github.com/bup/bup|{{AUR|bup}}}}<br />
* {{App|ColdStorage|Another backup tool using Git at its core, written in [[Qt]].|http://gitorious.org/coldstorage|{{AUR|coldstorage-git}}}}<br />
<br />
== External Resources ==<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
* [http://www.askapache.com/security/mirror-using-rsync-ssh.html Mirroring an Entire Site using Rsync over SSH]</div>Chionsashttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=259402Synchronization and backup programs2013-05-28T20:03:36Z<p>Chionsas: fixed wiki link</p>
<hr />
<div>[[Category:Data compression and archiving]]<br />
[[Category:System recovery]]<br />
[[ru:Backup Programs]]<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files ({{Ic|/etc/*}}) and the local pacman database (usually {{Ic|/var/lib/pacman/local/*}}).<br />
<br />
== Introduction ==<br />
Before you start trying various programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available? (CD, DVD, remote server, external hard drive, etc.)<br />
* How often do I plan to backup? (daily, weekly, monthly, etc.)<br />
* What features do I expect from the backup solution? (compression, encryption, handles renames, etc.)<br />
* How do I plan to restore backups if needed?<br />
<br />
== Incremental backups ==<br />
Applications that can do incremental backups remember and take into account what data has been backed up during the last run and eliminate the need to have duplicates of unchanged data. Restoring the data to a certain point in time would require locating the last full backup and all the incremental backups from then to the moment when it is supposed to be restored. This sort of backup is useful for those who do it very often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe how the contents of files and folders changed from the last backup (so-called 'diffs'). Hence, they are inherently incremental, but usually they do not have compression or encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. A downside to rsync-type programs is that they cannot be easily burned and restored from a CD or DVD.<br />
<br />
==== Console ====<br />
* {{App|[[rsync]]|A file transfer program to keep remote files in sync.<br />
** rsync almost always makes a mirror of the source.<br />
** Impossible to restore a full backup before the most recent backup (but you can use --backup to keep old versions of the files).<br />
** Standard install on all distros.<br />
** Can run over SSH (port 22) or native rsync protocol (port 873).<br />
** Win32 version available.<br />
|http://rsync.samba.org/|{{Pkg|rsync}}}}<br />
<br />
* {{App|[[Wikipedia:Rsync#Variations|rdiff-backup]]|A utility for local/remote mirroring and incremental backups.<br />
** Stores the most recent backup as regular files.<br />
** To revert to older versions, you apply the diff files to recreate the older versions.<br />
** It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change.<br />
** Win32 version available.<br />
|http://www.nongnu.org/rdiff-backup/|{{Pkg|rdiff-backup}}}}<br />
<br />
* {{App|[[rsnapshot]]|A remote filesystem snapshot utility.<br />
** Does not store diffs, instead it copies entire files if they have changed.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
** Destination filesystem must support hard links.<br />
** Win32 version available.<br />
|http://www.rsnapshot.org/|{{Pkg|rsnapshot}}}}<br />
<br />
* {{App|SafeKeep|A client/server backup system which uses rdiff-backup.<br />
** Integrates with Linux LVM and databases to create consistent backups.<br />
** Bandwidth throttling.<br />
|http://safekeep.sourceforge.net/|{{AUR|safekeep}}}}<br />
<br />
* {{App|Link-Backup|A tool similar to rsync based scripts, but which does not use rsync.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer.<br />
** The backup directory contains {{ic|.catalog}}, a catalog of all unique file instances; backup trees hard-link to this catalog.<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script.<br />
** It copies itself to the server; it does not need to be installed on the server.<br />
** Requires SSH for remote backups.<br />
** It resumes stopped backups; it can even be told to run for an arbitrary number of minutes.<br />
|http://www.scottlu.com/Content/Link-Backup.html|{{AUR|link-backup}}}}<br />
<br />
* {{App|[[Wikipedia:Unison (file synchronizer)|Unison]]|A program that synchronizes files between two machines over network (LAN or Inet) using a smart diff method + rsync. Allows the user to interactively choose which changes to push, pull, or merge.|http://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
<br />
* {{App|oldtime|A highly customizable and configurable backup & restore system.|https://github.com/GutenYe/oldtime|{{AUR?|oldtime}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Back In Time|A simple backup tool for Linux inspired by the [[Wikipedia:FlyBack|FlyBack]] and [https://wiki.ubuntu.com/TimeVault/ TimeVault] projects.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Really is just a front-end to {{ic|rsync}}, {{ic|diff}}, {{ic|cp}}.<br />
** A new snapshot is created only if something changed since the last snapshot.<br />
|http://backintime.le-web.org/|{{AUR|backintime}}}}<br />
<br />
* {{App|[[Wikipedia:FlyBack|FlyBack]]|A clone of Apple's [[Wikipedia:Time Machine (Mac OS)|Time Machine]], a backup utility for Mac OS X.|http://www.flyback-project.org/|{{AUR|flyback}}}}<br />
<br />
* {{App|[[Wikipedia:Areca Backup|Areca Backup]]|An easy to use and reliable backup solution for Linux and Windows.<br />
** Written in Java.<br />
** Primarily archive-based (zip), but will do file-based backup as well.<br />
** Delta backup supported (stores only changes).<br />
|http://areca.sourceforge.net/|{{AUR|areca}}}}<br />
<br />
* {{App|[[Wikipedia:LuckyBackup|luckyBackup]]|An easy program to backup and sync your files.<br />
** It is written in Qt and C++.<br />
** It has sync, backup (with include and exclude options) and restore capabilities.<br />
** It can do remote connection backups, scheduled backups.<br />
** A command line mode.<br />
|http://luckybackup.sourceforge.net/index.html|{{AUR|luckybackup}}}}<br />
<br />
* {{App|syncBackup|A front-end for rsync that provides a fast and extraordinary copying tool. It offers the most common options that control its behavior and permit very flexible specification of the set of files to be copied.<br />
|http://www.darhon.com/syncbackup|{{AUR|syncbackup}}}}<br />
<br />
* {{App|[[BackupPC]]|A high-performance, enterprise-grade system for backing up Unix, Linux, Windows, and Mac OS X desktops and laptops to a remote server.<br />
** Deduplication: Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.<br />
** Optional compression support further reducing disk storage.<br />
** No client-side software is needed.<br />
** Simple but powerful web-based UI.<br />
|http://backuppc.sourceforge.net/index.html|{{Pkg|backuppc}}}}<br />
<br />
=== Other backups ===<br />
Most other backup applications tend to create (big) archive files and (of course) keep track of what's been archived. Creating {{ic|.tar.bz2}} or {{ic|.tar.gz}} archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you do not need to have the backup program around.<br />
<br />
==== Console ====<br />
* {{App|Arch Backup|A trivial backup script with simple configuration.<br />
** Configurable compression method.<br />
** Multiple backup targets.<br />
|http://code.google.com/p/archlinux-stuff/|{{Pkg|arch-backup}}}}<br />
<br />
* {{App|[[Backup with hdup|hdup]]|A very simple command line backup tool.<br />
** Creates tar.gz or tar.bz2 archives.<br />
** Supports gpg encryption.<br />
** Supports pushing over SSH.<br />
** Multiple backup targets.<br />
|http://miek.nl/projects/hdup2/|{{AUR|hdup}}}}<br />
<br />
* {{App|rdup|A platform for backups that provides scripts to facilitate backups and delegates the encryption, compression, transfer and packaging to other utilities in a true Unix-way.<br />
** Creates tar.gz archives or rsync-type copy.<br />
** Encryption (gpg, blowfish and others); also applies for rsync-type copy.<br />
** Compression (also for rsync-type copy).<br />
|http://miek.nl/projects/rdup|{{AUR|rdup}}}}<br />
<br />
* {{App|[[Duplicity]]|A simple command-line utility which allows encrypted compressed incremental backup to nearly any storage.<br />
** Supports gpg encryption and signing.<br />
** Supports gzip compression.<br />
** Supports full or incremental backups, incremental backup stores only difference between new and old file.<br />
** Supports pushing over FTP, SSH, rsync, WebDAV, WebDAVs, HSi and Amazon S3 or local filesystem.<br />
|http://www.nongnu.org/duplicity/|{{Pkg|duplicity}}}}<br />
<br />
* {{App|[[Wikipedia:DAR (Disk Archiver)|DAR]]|A full-featured command-line backup tool, short for Disk ARchive.<br />
** It uses its own format for archives (so you need to have it around when you want to restore).<br />
** Supports splitting backups into more files by size.<br />
** Makefile-type config files, some custom scripts are available along with it.<br />
** Supports basic encryption.<br />
** Automatic backup using [[cron]] is possible with {{AUR|sarab}}.<br />
|http://dar.linux.free.fr/|{{AUR|dar}} {{AUR|kdar}} (fontend)}}<br />
<br />
* {{App|Manent|An algorithmically strong backup and archival program. NOTE: no upstream activity since 2009.<br />
** Efficient backup to anything that looks like a storage.<br />
** Works well over a slow and unreliable network.<br />
** Offers online access to the contents of the backup.<br />
** Backed up storage is completely encrypted.<br />
** Several computers can use the same storage for backup, automatically sharing data.<br />
** Not reliant on timestamps of the remote system to detect changes.<br />
** Cross-platform support for Unicode file names.<br />
|http://code.google.com/p/manent/|{{AUR|manent}}}}<br />
<br />
* {{App|btar|tar-compatible archiver<br />
** Fast archive creation (multicore compression or ciphering)<br />
** Arbitrary chain of compression/ciphers (calls any compression/ciphering programs)<br />
** Indexed archive retrieval or listing<br />
** Redundancy<br />
** Serialization through pipes (and only one file per backup)<br />
** Can be extracted or checked with gnutar<br />
** Differential backups of multiple levels<br />
** Optional encoding of big files with rsync-differences<br />
|http://viric.name/cgi-bin/btar|{{AUR|btar}}}}<br />
<br />
* {{App|obnam|Easy, secure backup program<br />
** Uses snapshots instead of full/incremental backups<br />
|http://liw.fi/obnam/|{{AUR|obnam}}}}<br />
<br />
* {{App|System Tar & Restore|A set of bash scripts for full system backup and restore<br />
** CLI and Dialog interfaces, Zenity wrappers<br />
** Easy backup and restore wizards<br />
** Uses tar to create and restore backups<br />
** Creates tar.gz or tar.xz archives<br />
** Uses rsync to transfer a running system<br />
** Supports Grub2 and Syslinux<br />
|http://code.google.com/p/system-tar-and-restore/|{{AUR|system-tar-and-restore}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Backerupper|A simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** Creates {{ic|.tar.gz}} archives.<br />
** Configurable backup frequency, backup time and max copies.<br />
|http://sourceforge.net/projects/backerupper/|{{AUR|backerupper}}}}<br />
<br />
* {{App|[[Duplicity|Déjà Dup]]|A simple GTK+ backup program. It hides the complexity of doing backups the 'right way' (encrypted, off-site, and regular) and uses duplicity as the backend.<br />
** Automatic, timed backup configurable in GUI.<br />
** Restore wizard.<br />
** Integrated into the Nautilus file manager.<br />
** Inherits several features of duplicity.<br />
|https://launchpad.net/deja-dup|{{Pkg|deja-dup|}}}}<br />
<br />
* {{App|Synkron|A folder synchronization tool.<br />
** Syncs multiple folders.<br />
** Can exclude files from sync based on wildcards.<br />
** Restores files.<br />
** Cross-platform support.<br />
|http://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
<br />
== Cloud backups ==<br />
* {{App|[[Wikipedia:CrashPlan|CrashPlan]]|An online/offsite backup solution.<br />
** Unlimited online space for very reasonable pricing.<br />
** Automatic and incremental backups to multiple destinations.<br />
** Intuitive GUI.<br />
** Offers encryption and de-duplication.<br />
** Software is generally free.<br />
|http://www.crashplan.com/|{{AUR|crashplan}}}}<br />
<br />
* {{App|[[Dropbox]]|A popular file-sharing service.<br />
** A daemon monitors a specified directory, and uploads incremental changes to dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
|http://www.getdropbox.com|{{AUR|dropbox}} {{AUR|nautilus-dropbox}}}}<br />
<br />
* {{App|[[Wikipedia:Jungle Disk|Jungle Disk]]|An online backup tool that stores its data in Amazon S3 or Rackspace Cloud Files.<br />
** A Nautilus extension.<br />
** Only paid plans available.<br />
|http://www.jungledisk.com/|{{AUR|nautilus-jungledisk}}}}<br />
<br />
* {{App|Tarsnap|A secure online backup service for BSD, Linux, OS X, Solaris and Windows (through Cygwin).<br />
** Compressed encrypted backups to Amazon S3 Servers.<br />
** Automate via [[cron]].<br />
** Incremental backups.<br />
** Backup any files or directories.<br />
** Command line only client.<br />
** Pay only for usage (bandwidth and storage). <br />
|http://www.tarsnap.com|{{Pkg|tarsnap}}}}<br />
<br />
* {{App|[[Wikipedia:Wuala|Wuala]]|A secure online storage, file synchronization, versioning and backup service.<br />
** Closed source, free and paid version available.<br />
** Free account holds 5GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
** Social networking features.<br />
** All files in the cloud are first encrypted locally.<br />
|http://www.wuala.com/|{{AUR|wuala}}, {{AUR|wuala-daemon}} &ndash; to run as daemon}}<br />
<br />
* {{App|[[Wikipedia:SpiderOak|SpiderOak]]|An online backup tool for Windows, Mac and Linux users to back up, share, sync, access and store[1] their data.<br />
** Free and paid version available.<br />
** Free account holds 2GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
|https://spideroak.com/|{{AUR|spideroak}}}}<br />
<br />
* {{App|[[Ubuntu One]]|An online storage service with sync and sharing across platforms.<br />
** Free and payed versions available.<br />
** Free account with 5GB.<br />
** Mobile access.<br />
** Music streaming.<br />
|https://one.ubuntu.com/services/|{{Pkg|ubuntuone-client}}}}<br />
<br />
* {{App|Packrat|A simple, modular backup system that uses [[Wikipedia:DAR (Disk Archiver)|DAR]] to take full or incremental backups of files and can store them locally, on a remote system via SSH, or on Amazon S3.|http://www.zeroflux.org/projects|{{AUR|packrat}}}}<br />
<br />
== Cooperative storage cloud backups ==<br />
<br />
A [[Wikipedia:Cooperative_storage_cloud|cooperative storage cloud]] is a decentralized model of networked online storage where data is stored on multiple computers, hosted by the participants cooperating in the cloud. <br />
<br />
* {{App|[http://www.symform.com Symform]| A peer-to-peer cloud backup service.<br />
** Unlimited free backup in exchange for 2:1 storage space contribution with an always-connected device (at least 80% uptime).<br />
** [http://www.symform.com/our-solutions/pricing/ Payment options exist].<br />
** First 10GB of backup storage is free (no contribution needed).<br />
** In addition to paid support, support plans in exchange for extended contribution (300GB+) exist.<br />
** Automatic and incremental backups.<br />
** Data is encrypted before leaving the computer, though keys are also stored on the Symform's servers.<br />
** Customizable limits for bandwidth consumption.<br />
** Ability to have a local copy ("Hot Copy") of the backed up data on a different disk or computer.<br />
** Ability to have synchronized folders between nodes (Dropbox-like).<br />
|http://www.symform.com/|{{AUR|symform}}}}<br />
<br />
== Non-incremental backups ==<br />
Another type of backups are those used in case of a disaster. These include application that allow easy backup of entire filesystems and recovery in case of failure, usually in the form of a Live CD or USB drive. The contains complete system images from one or more specific points in time and are frequently used by to record known good configurations.<br />
<br />
* {{App|Q7Z|P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar.<br />
** Updates existing archives quickly.<br />
** Backup multiple folders to a storage location.<br />
** Create or extract protected archives.<br />
** Lessen effort by using archiving profiles and lists.<br />
|http://k7z.sourceforge.net/|{{AUR|q7z}}}}<br />
<br />
* {{App|[[Partclone]]|A tool that can be used to back up and restore a partition while considering only used blocks.<br />
** Supports ext2, ext3, hfs+, reiser3.5, reiser3.6, reiser4, ext4 and btrfs.<br />
** Supports compression.<br />
|http://partclone.nchc.org.tw/trac/|{{AUR|partclone}}}}<br />
<br />
* {{App|[[Wikipedia:Redo Backup and Recovery|Redo Backup and Recovery]]|A backup and disaster recovery application that runs from a bootable Linux CD image.<br />
** Is capable of bare-metal backup and recovery of disk partitions.<br />
** Uses [http://www.xpud.org/ xPUD] and [[Partclone]] for the backend.<br />
|http://www.redobackup.org/|{{AUR?|redobackup}}}}<br />
<br />
* {{App|[[Wikipedia:Clonezilla|Clonezilla]]|A disaster recovery, disk cloning, disk imaging and deployment solution.<br />
** Boots from live CD, USB flash drive, or PXE server.<br />
** Supports ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs, btrfs FAT32, NTFS, HFS+ and others.<br />
** Uses Partclone (default), Partimage (optional), ntfsclone (optional), or dd to image or clone a partition.<br />
** Multicasting server to restore to many machines at once.<br />
|http://clonezilla.org/|{{AUR|clonezilla}}}}<br />
<br />
* {{App|[[Wikipedia:Partimage|Partimage]]|A disk cloning utility for Linux/UNIX environments.<br />
** Has a Live CD.<br />
** Supports the most popular filesystems on Linux, Windows and Mac OS.<br />
** Compression.<br />
** Saving to multiple CDs or DVDs or across a network using Samba/NFS.<br />
|http://www.partimage.org/Main_Page|{{Pkg|partimage}}}}<br />
<br />
* {{App|FSArchiver|A safe and flexible file-system backup and deployment tool<br />
** Support for basic file attributes (permissions, owner, ...).<br />
** Support for multiple file-systems per archive.<br />
** Support for extended attributes (they are used by SELinux).<br />
** Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems.<br />
** Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of a Windows partitions).<br />
** Checksumming of everything which is written in the archive (headers, data blocks, whole files).<br />
** Ability to restore an archive which is corrupt (it will just skip the current file).<br />
** Multi-threaded lzo, gzip, bzip2, lzma compression.<br />
** Support for splitting large archives into several files with a fixed maximum size.<br />
** Encryption of the archive using a password. Based on blowfish from libcrypto from [[OpenSSL]].<br />
** Support backup of a mounted root filesystem (-A option).<br />
|http://www.fsarchiver.org/Main_Page|{{Pkg|fsarchiver}}}}<br />
<br />
* {{App|[[Wikipedia:Mondo Rescue|Mondo Rescue]]|A disaster recovery solution to create backup media that can be used to redeploy the damaged system.<br />
** Image-based backups, supporting Linux/Windows.<br />
** Compression rate is adjustable.<br />
** Can backup live systems (without having to halt it).<br />
** Can split image over many files.<br />
** Supports booting to a Live CD to perform a full restore.<br />
** Can backup/restore over NFS, from CDs, tape drives and and other media.<br />
** Can verify backups.<br />
|http://www.mondorescue.org/|{{AUR|mondo}}}}<br />
<br />
== Versioning systems ==<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
=== Version control systems ===<br />
{{Wikipedia|Comparison of revision control software}}.<br />
<br />
* {{App|[[Git]]|A distributed revision control and source code management system with an emphasis on speed.<br />
** Very easy creation, merging, and deletion of branches.<br />
** Nearly all operations are performed locally, giving it a huge speed advantage on centralized systems.<br />
** Has a "staging area" or "index", this is an intermediate area where commits can be formatted and reviewed before completing the commit.<br />
** Does not handle binary files very well.<br />
|http://git-scm.com/|{{Pkg|git}}}}<br />
<br />
* {{App|[[Subversion]]|A full-featured centralized version control system originally designed to be a better CVS.<br />
** Renamed/copied/moved/removed files retain full revision history.<br />
** Native support for binary files, with space-efficient binary-diff storage.<br />
** Costs proportional to change size, not to data size.<br />
** Allows arbitrary metadata ("properties") to be attached to any file or directory. <br />
|http://subversion.apache.org/|{{Pkg|subversion}}}}<br />
<br />
* {{App|[[Mercurial]]|A distributed version control system written in Python and similar in many ways to Git.<br />
** Platform independent.<br />
** Support for [http://mercurial.selenic.com/wiki/UsingExtensions extensions].<br />
** A set of commands consistent with Subversion.<br />
** Supports tags.<br />
|http://mercurial.selenic.com/|{{Pkg|mercurial}}}}<br />
<br />
* {{App|[[Wikipedia:Bazaar (software)|Bazaar]]|A distributed version control system that helps you track project history over time and to collaborate easily with others.<br />
** Similar commands to Subversion.<br />
** Supports working with or without a central server.<br />
** Support for working with some other revision control systems<br />
** Complete Unicode support.<br />
|http://bazaar.canonical.com/en/|{{Pkg|bzr}}}}<br />
<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|A distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.<br />
** Offline mode.<br />
** Easy branching and merging.<br />
** Written in Haskell.<br />
** Not very fast.<br />
|http://darcs.net/|{{AUR|darcs}}}}<br />
<br />
=== VCS-based backups ===<br />
<br />
* {{App|Gibak|A backup system based on [[Git]].<br />
** Supports binary diffs.<br />
** Uses all of Git's features (such as {{ic|.gitignore}} for filtering files).<br />
** Uses Git's hook system to save information that Git does not (permissions, mtime, empty directories, etc).<br />
|https://github.com/pangloss/gibak|{{AUR|gibak}}}}<br />
* {{App|bup|A fledgling Git-based backup solution written in Python and C.<br />
** Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks.<br />
** Can back up directly to a remote bup server.<br />
** Has an improved index format to allow you to track many files.<br />
|https://github.com/bup/bup|{{AUR|bup}}}}<br />
* {{App|ColdStorage|Another backup tool using Git at its core, written in [[Qt]].|http://gitorious.org/coldstorage|{{AUR|coldstorage-git}}}}<br />
<br />
== External Resources ==<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
* [http://www.askapache.com/security/mirror-using-rsync-ssh.html Mirroring an Entire Site using Rsync over SSH]</div>Chionsashttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=259401Synchronization and backup programs2013-05-28T20:02:25Z<p>Chionsas: added link to Symform's title</p>
<hr />
<div>[[Category:Data compression and archiving]]<br />
[[Category:System recovery]]<br />
[[ru:Backup Programs]]<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files ({{Ic|/etc/*}}) and the local pacman database (usually {{Ic|/var/lib/pacman/local/*}}).<br />
<br />
== Introduction ==<br />
Before you start trying various programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available? (CD, DVD, remote server, external hard drive, etc.)<br />
* How often do I plan to backup? (daily, weekly, monthly, etc.)<br />
* What features do I expect from the backup solution? (compression, encryption, handles renames, etc.)<br />
* How do I plan to restore backups if needed?<br />
<br />
== Incremental backups ==<br />
Applications that can do incremental backups remember and take into account what data has been backed up during the last run and eliminate the need to have duplicates of unchanged data. Restoring the data to a certain point in time would require locating the last full backup and all the incremental backups from then to the moment when it is supposed to be restored. This sort of backup is useful for those who do it very often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe how the contents of files and folders changed from the last backup (so-called 'diffs'). Hence, they are inherently incremental, but usually they do not have compression or encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. A downside to rsync-type programs is that they cannot be easily burned and restored from a CD or DVD.<br />
<br />
==== Console ====<br />
* {{App|[[rsync]]|A file transfer program to keep remote files in sync.<br />
** rsync almost always makes a mirror of the source.<br />
** Impossible to restore a full backup before the most recent backup (but you can use --backup to keep old versions of the files).<br />
** Standard install on all distros.<br />
** Can run over SSH (port 22) or native rsync protocol (port 873).<br />
** Win32 version available.<br />
|http://rsync.samba.org/|{{Pkg|rsync}}}}<br />
<br />
* {{App|[[Wikipedia:Rsync#Variations|rdiff-backup]]|A utility for local/remote mirroring and incremental backups.<br />
** Stores the most recent backup as regular files.<br />
** To revert to older versions, you apply the diff files to recreate the older versions.<br />
** It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change.<br />
** Win32 version available.<br />
|http://www.nongnu.org/rdiff-backup/|{{Pkg|rdiff-backup}}}}<br />
<br />
* {{App|[[rsnapshot]]|A remote filesystem snapshot utility.<br />
** Does not store diffs, instead it copies entire files if they have changed.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
** Destination filesystem must support hard links.<br />
** Win32 version available.<br />
|http://www.rsnapshot.org/|{{Pkg|rsnapshot}}}}<br />
<br />
* {{App|SafeKeep|A client/server backup system which uses rdiff-backup.<br />
** Integrates with Linux LVM and databases to create consistent backups.<br />
** Bandwidth throttling.<br />
|http://safekeep.sourceforge.net/|{{AUR|safekeep}}}}<br />
<br />
* {{App|Link-Backup|A tool similar to rsync based scripts, but which does not use rsync.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer.<br />
** The backup directory contains {{ic|.catalog}}, a catalog of all unique file instances; backup trees hard-link to this catalog.<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script.<br />
** It copies itself to the server; it does not need to be installed on the server.<br />
** Requires SSH for remote backups.<br />
** It resumes stopped backups; it can even be told to run for an arbitrary number of minutes.<br />
|http://www.scottlu.com/Content/Link-Backup.html|{{AUR|link-backup}}}}<br />
<br />
* {{App|[[Wikipedia:Unison (file synchronizer)|Unison]]|A program that synchronizes files between two machines over network (LAN or Inet) using a smart diff method + rsync. Allows the user to interactively choose which changes to push, pull, or merge.|http://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
<br />
* {{App|oldtime|A highly customizable and configurable backup & restore system.|https://github.com/GutenYe/oldtime|{{AUR?|oldtime}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Back In Time|A simple backup tool for Linux inspired by the [[Wikipedia:FlyBack|FlyBack]] and [https://wiki.ubuntu.com/TimeVault/ TimeVault] projects.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Really is just a front-end to {{ic|rsync}}, {{ic|diff}}, {{ic|cp}}.<br />
** A new snapshot is created only if something changed since the last snapshot.<br />
|http://backintime.le-web.org/|{{AUR|backintime}}}}<br />
<br />
* {{App|[[Wikipedia:FlyBack|FlyBack]]|A clone of Apple's [[Wikipedia:Time Machine (Mac OS)|Time Machine]], a backup utility for Mac OS X.|http://www.flyback-project.org/|{{AUR|flyback}}}}<br />
<br />
* {{App|[[Wikipedia:Areca Backup|Areca Backup]]|An easy to use and reliable backup solution for Linux and Windows.<br />
** Written in Java.<br />
** Primarily archive-based (zip), but will do file-based backup as well.<br />
** Delta backup supported (stores only changes).<br />
|http://areca.sourceforge.net/|{{AUR|areca}}}}<br />
<br />
* {{App|[[Wikipedia:LuckyBackup|luckyBackup]]|An easy program to backup and sync your files.<br />
** It is written in Qt and C++.<br />
** It has sync, backup (with include and exclude options) and restore capabilities.<br />
** It can do remote connection backups, scheduled backups.<br />
** A command line mode.<br />
|http://luckybackup.sourceforge.net/index.html|{{AUR|luckybackup}}}}<br />
<br />
* {{App|syncBackup|A front-end for rsync that provides a fast and extraordinary copying tool. It offers the most common options that control its behavior and permit very flexible specification of the set of files to be copied.<br />
|http://www.darhon.com/syncbackup|{{AUR|syncbackup}}}}<br />
<br />
* {{App|[[BackupPC]]|A high-performance, enterprise-grade system for backing up Unix, Linux, Windows, and Mac OS X desktops and laptops to a remote server.<br />
** Deduplication: Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.<br />
** Optional compression support further reducing disk storage.<br />
** No client-side software is needed.<br />
** Simple but powerful web-based UI.<br />
|http://backuppc.sourceforge.net/index.html|{{Pkg|backuppc}}}}<br />
<br />
=== Other backups ===<br />
Most other backup applications tend to create (big) archive files and (of course) keep track of what's been archived. Creating {{ic|.tar.bz2}} or {{ic|.tar.gz}} archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you do not need to have the backup program around.<br />
<br />
==== Console ====<br />
* {{App|Arch Backup|A trivial backup script with simple configuration.<br />
** Configurable compression method.<br />
** Multiple backup targets.<br />
|http://code.google.com/p/archlinux-stuff/|{{Pkg|arch-backup}}}}<br />
<br />
* {{App|[[Backup with hdup|hdup]]|A very simple command line backup tool.<br />
** Creates tar.gz or tar.bz2 archives.<br />
** Supports gpg encryption.<br />
** Supports pushing over SSH.<br />
** Multiple backup targets.<br />
|http://miek.nl/projects/hdup2/|{{AUR|hdup}}}}<br />
<br />
* {{App|rdup|A platform for backups that provides scripts to facilitate backups and delegates the encryption, compression, transfer and packaging to other utilities in a true Unix-way.<br />
** Creates tar.gz archives or rsync-type copy.<br />
** Encryption (gpg, blowfish and others); also applies for rsync-type copy.<br />
** Compression (also for rsync-type copy).<br />
|http://miek.nl/projects/rdup|{{AUR|rdup}}}}<br />
<br />
* {{App|[[Duplicity]]|A simple command-line utility which allows encrypted compressed incremental backup to nearly any storage.<br />
** Supports gpg encryption and signing.<br />
** Supports gzip compression.<br />
** Supports full or incremental backups, incremental backup stores only difference between new and old file.<br />
** Supports pushing over FTP, SSH, rsync, WebDAV, WebDAVs, HSi and Amazon S3 or local filesystem.<br />
|http://www.nongnu.org/duplicity/|{{Pkg|duplicity}}}}<br />
<br />
* {{App|[[Wikipedia:DAR (Disk Archiver)|DAR]]|A full-featured command-line backup tool, short for Disk ARchive.<br />
** It uses its own format for archives (so you need to have it around when you want to restore).<br />
** Supports splitting backups into more files by size.<br />
** Makefile-type config files, some custom scripts are available along with it.<br />
** Supports basic encryption.<br />
** Automatic backup using [[cron]] is possible with {{AUR|sarab}}.<br />
|http://dar.linux.free.fr/|{{AUR|dar}} {{AUR|kdar}} (fontend)}}<br />
<br />
* {{App|Manent|An algorithmically strong backup and archival program. NOTE: no upstream activity since 2009.<br />
** Efficient backup to anything that looks like a storage.<br />
** Works well over a slow and unreliable network.<br />
** Offers online access to the contents of the backup.<br />
** Backed up storage is completely encrypted.<br />
** Several computers can use the same storage for backup, automatically sharing data.<br />
** Not reliant on timestamps of the remote system to detect changes.<br />
** Cross-platform support for Unicode file names.<br />
|http://code.google.com/p/manent/|{{AUR|manent}}}}<br />
<br />
* {{App|btar|tar-compatible archiver<br />
** Fast archive creation (multicore compression or ciphering)<br />
** Arbitrary chain of compression/ciphers (calls any compression/ciphering programs)<br />
** Indexed archive retrieval or listing<br />
** Redundancy<br />
** Serialization through pipes (and only one file per backup)<br />
** Can be extracted or checked with gnutar<br />
** Differential backups of multiple levels<br />
** Optional encoding of big files with rsync-differences<br />
|http://viric.name/cgi-bin/btar|{{AUR|btar}}}}<br />
<br />
* {{App|obnam|Easy, secure backup program<br />
** Uses snapshots instead of full/incremental backups<br />
|http://liw.fi/obnam/|{{AUR|obnam}}}}<br />
<br />
* {{App|System Tar & Restore|A set of bash scripts for full system backup and restore<br />
** CLI and Dialog interfaces, Zenity wrappers<br />
** Easy backup and restore wizards<br />
** Uses tar to create and restore backups<br />
** Creates tar.gz or tar.xz archives<br />
** Uses rsync to transfer a running system<br />
** Supports Grub2 and Syslinux<br />
|http://code.google.com/p/system-tar-and-restore/|{{AUR|system-tar-and-restore}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Backerupper|A simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** Creates {{ic|.tar.gz}} archives.<br />
** Configurable backup frequency, backup time and max copies.<br />
|http://sourceforge.net/projects/backerupper/|{{AUR|backerupper}}}}<br />
<br />
* {{App|[[Duplicity|Déjà Dup]]|A simple GTK+ backup program. It hides the complexity of doing backups the 'right way' (encrypted, off-site, and regular) and uses duplicity as the backend.<br />
** Automatic, timed backup configurable in GUI.<br />
** Restore wizard.<br />
** Integrated into the Nautilus file manager.<br />
** Inherits several features of duplicity.<br />
|https://launchpad.net/deja-dup|{{Pkg|deja-dup|}}}}<br />
<br />
* {{App|Synkron|A folder synchronization tool.<br />
** Syncs multiple folders.<br />
** Can exclude files from sync based on wildcards.<br />
** Restores files.<br />
** Cross-platform support.<br />
|http://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
<br />
== Cloud backups ==<br />
* {{App|[[Wikipedia:CrashPlan|CrashPlan]]|An online/offsite backup solution.<br />
** Unlimited online space for very reasonable pricing.<br />
** Automatic and incremental backups to multiple destinations.<br />
** Intuitive GUI.<br />
** Offers encryption and de-duplication.<br />
** Software is generally free.<br />
|http://www.crashplan.com/|{{AUR|crashplan}}}}<br />
<br />
* {{App|[[Dropbox]]|A popular file-sharing service.<br />
** A daemon monitors a specified directory, and uploads incremental changes to dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
|http://www.getdropbox.com|{{AUR|dropbox}} {{AUR|nautilus-dropbox}}}}<br />
<br />
* {{App|[[Wikipedia:Jungle Disk|Jungle Disk]]|An online backup tool that stores its data in Amazon S3 or Rackspace Cloud Files.<br />
** A Nautilus extension.<br />
** Only paid plans available.<br />
|http://www.jungledisk.com/|{{AUR|nautilus-jungledisk}}}}<br />
<br />
* {{App|Tarsnap|A secure online backup service for BSD, Linux, OS X, Solaris and Windows (through Cygwin).<br />
** Compressed encrypted backups to Amazon S3 Servers.<br />
** Automate via [[cron]].<br />
** Incremental backups.<br />
** Backup any files or directories.<br />
** Command line only client.<br />
** Pay only for usage (bandwidth and storage). <br />
|http://www.tarsnap.com|{{Pkg|tarsnap}}}}<br />
<br />
* {{App|[[Wikipedia:Wuala|Wuala]]|A secure online storage, file synchronization, versioning and backup service.<br />
** Closed source, free and paid version available.<br />
** Free account holds 5GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
** Social networking features.<br />
** All files in the cloud are first encrypted locally.<br />
|http://www.wuala.com/|{{AUR|wuala}}, {{AUR|wuala-daemon}} &ndash; to run as daemon}}<br />
<br />
* {{App|[[Wikipedia:SpiderOak|SpiderOak]]|An online backup tool for Windows, Mac and Linux users to back up, share, sync, access and store[1] their data.<br />
** Free and paid version available.<br />
** Free account holds 2GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
|https://spideroak.com/|{{AUR|spideroak}}}}<br />
<br />
* {{App|[[Ubuntu One]]|An online storage service with sync and sharing across platforms.<br />
** Free and payed versions available.<br />
** Free account with 5GB.<br />
** Mobile access.<br />
** Music streaming.<br />
|https://one.ubuntu.com/services/|{{Pkg|ubuntuone-client}}}}<br />
<br />
* {{App|Packrat|A simple, modular backup system that uses [[Wikipedia:DAR (Disk Archiver)|DAR]] to take full or incremental backups of files and can store them locally, on a remote system via SSH, or on Amazon S3.|http://www.zeroflux.org/projects|{{AUR|packrat}}}}<br />
<br />
== Cooperative storage cloud backups ==<br />
<br />
A [[cooperative storage cloud|Wikipedia:Cooperative_storage_cloud]] is a decentralized model of networked online storage where data is stored on multiple computers, hosted by the participants cooperating in the cloud. <br />
<br />
* {{App|[http://www.symform.com Symform]| A peer-to-peer cloud backup service.<br />
** Unlimited free backup in exchange for 2:1 storage space contribution with an always-connected device (at least 80% uptime).<br />
** [http://www.symform.com/our-solutions/pricing/ Payment options exist].<br />
** First 10GB of backup storage is free (no contribution needed).<br />
** In addition to paid support, support plans in exchange for extended contribution (300GB+) exist.<br />
** Automatic and incremental backups.<br />
** Data is encrypted before leaving the computer, though keys are also stored on the Symform's servers.<br />
** Customizable limits for bandwidth consumption.<br />
** Ability to have a local copy ("Hot Copy") of the backed up data on a different disk or computer.<br />
** Ability to have synchronized folders between nodes (Dropbox-like).<br />
|http://www.symform.com/|{{AUR|symform}}}}<br />
<br />
== Non-incremental backups ==<br />
Another type of backups are those used in case of a disaster. These include application that allow easy backup of entire filesystems and recovery in case of failure, usually in the form of a Live CD or USB drive. The contains complete system images from one or more specific points in time and are frequently used by to record known good configurations.<br />
<br />
* {{App|Q7Z|P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar.<br />
** Updates existing archives quickly.<br />
** Backup multiple folders to a storage location.<br />
** Create or extract protected archives.<br />
** Lessen effort by using archiving profiles and lists.<br />
|http://k7z.sourceforge.net/|{{AUR|q7z}}}}<br />
<br />
* {{App|[[Partclone]]|A tool that can be used to back up and restore a partition while considering only used blocks.<br />
** Supports ext2, ext3, hfs+, reiser3.5, reiser3.6, reiser4, ext4 and btrfs.<br />
** Supports compression.<br />
|http://partclone.nchc.org.tw/trac/|{{AUR|partclone}}}}<br />
<br />
* {{App|[[Wikipedia:Redo Backup and Recovery|Redo Backup and Recovery]]|A backup and disaster recovery application that runs from a bootable Linux CD image.<br />
** Is capable of bare-metal backup and recovery of disk partitions.<br />
** Uses [http://www.xpud.org/ xPUD] and [[Partclone]] for the backend.<br />
|http://www.redobackup.org/|{{AUR?|redobackup}}}}<br />
<br />
* {{App|[[Wikipedia:Clonezilla|Clonezilla]]|A disaster recovery, disk cloning, disk imaging and deployment solution.<br />
** Boots from live CD, USB flash drive, or PXE server.<br />
** Supports ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs, btrfs FAT32, NTFS, HFS+ and others.<br />
** Uses Partclone (default), Partimage (optional), ntfsclone (optional), or dd to image or clone a partition.<br />
** Multicasting server to restore to many machines at once.<br />
|http://clonezilla.org/|{{AUR|clonezilla}}}}<br />
<br />
* {{App|[[Wikipedia:Partimage|Partimage]]|A disk cloning utility for Linux/UNIX environments.<br />
** Has a Live CD.<br />
** Supports the most popular filesystems on Linux, Windows and Mac OS.<br />
** Compression.<br />
** Saving to multiple CDs or DVDs or across a network using Samba/NFS.<br />
|http://www.partimage.org/Main_Page|{{Pkg|partimage}}}}<br />
<br />
* {{App|FSArchiver|A safe and flexible file-system backup and deployment tool<br />
** Support for basic file attributes (permissions, owner, ...).<br />
** Support for multiple file-systems per archive.<br />
** Support for extended attributes (they are used by SELinux).<br />
** Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems.<br />
** Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of a Windows partitions).<br />
** Checksumming of everything which is written in the archive (headers, data blocks, whole files).<br />
** Ability to restore an archive which is corrupt (it will just skip the current file).<br />
** Multi-threaded lzo, gzip, bzip2, lzma compression.<br />
** Support for splitting large archives into several files with a fixed maximum size.<br />
** Encryption of the archive using a password. Based on blowfish from libcrypto from [[OpenSSL]].<br />
** Support backup of a mounted root filesystem (-A option).<br />
|http://www.fsarchiver.org/Main_Page|{{Pkg|fsarchiver}}}}<br />
<br />
* {{App|[[Wikipedia:Mondo Rescue|Mondo Rescue]]|A disaster recovery solution to create backup media that can be used to redeploy the damaged system.<br />
** Image-based backups, supporting Linux/Windows.<br />
** Compression rate is adjustable.<br />
** Can backup live systems (without having to halt it).<br />
** Can split image over many files.<br />
** Supports booting to a Live CD to perform a full restore.<br />
** Can backup/restore over NFS, from CDs, tape drives and and other media.<br />
** Can verify backups.<br />
|http://www.mondorescue.org/|{{AUR|mondo}}}}<br />
<br />
== Versioning systems ==<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
=== Version control systems ===<br />
{{Wikipedia|Comparison of revision control software}}.<br />
<br />
* {{App|[[Git]]|A distributed revision control and source code management system with an emphasis on speed.<br />
** Very easy creation, merging, and deletion of branches.<br />
** Nearly all operations are performed locally, giving it a huge speed advantage on centralized systems.<br />
** Has a "staging area" or "index", this is an intermediate area where commits can be formatted and reviewed before completing the commit.<br />
** Does not handle binary files very well.<br />
|http://git-scm.com/|{{Pkg|git}}}}<br />
<br />
* {{App|[[Subversion]]|A full-featured centralized version control system originally designed to be a better CVS.<br />
** Renamed/copied/moved/removed files retain full revision history.<br />
** Native support for binary files, with space-efficient binary-diff storage.<br />
** Costs proportional to change size, not to data size.<br />
** Allows arbitrary metadata ("properties") to be attached to any file or directory. <br />
|http://subversion.apache.org/|{{Pkg|subversion}}}}<br />
<br />
* {{App|[[Mercurial]]|A distributed version control system written in Python and similar in many ways to Git.<br />
** Platform independent.<br />
** Support for [http://mercurial.selenic.com/wiki/UsingExtensions extensions].<br />
** A set of commands consistent with Subversion.<br />
** Supports tags.<br />
|http://mercurial.selenic.com/|{{Pkg|mercurial}}}}<br />
<br />
* {{App|[[Wikipedia:Bazaar (software)|Bazaar]]|A distributed version control system that helps you track project history over time and to collaborate easily with others.<br />
** Similar commands to Subversion.<br />
** Supports working with or without a central server.<br />
** Support for working with some other revision control systems<br />
** Complete Unicode support.<br />
|http://bazaar.canonical.com/en/|{{Pkg|bzr}}}}<br />
<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|A distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.<br />
** Offline mode.<br />
** Easy branching and merging.<br />
** Written in Haskell.<br />
** Not very fast.<br />
|http://darcs.net/|{{AUR|darcs}}}}<br />
<br />
=== VCS-based backups ===<br />
<br />
* {{App|Gibak|A backup system based on [[Git]].<br />
** Supports binary diffs.<br />
** Uses all of Git's features (such as {{ic|.gitignore}} for filtering files).<br />
** Uses Git's hook system to save information that Git does not (permissions, mtime, empty directories, etc).<br />
|https://github.com/pangloss/gibak|{{AUR|gibak}}}}<br />
* {{App|bup|A fledgling Git-based backup solution written in Python and C.<br />
** Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks.<br />
** Can back up directly to a remote bup server.<br />
** Has an improved index format to allow you to track many files.<br />
|https://github.com/bup/bup|{{AUR|bup}}}}<br />
* {{App|ColdStorage|Another backup tool using Git at its core, written in [[Qt]].|http://gitorious.org/coldstorage|{{AUR|coldstorage-git}}}}<br />
<br />
== External Resources ==<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
* [http://www.askapache.com/security/mirror-using-rsync-ssh.html Mirroring an Entire Site using Rsync over SSH]</div>Chionsashttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs&diff=259400Synchronization and backup programs2013-05-28T20:01:13Z<p>Chionsas: Added Symform to a new 'Cooperative storage cloud backups' section.</p>
<hr />
<div>[[Category:Data compression and archiving]]<br />
[[Category:System recovery]]<br />
[[ru:Backup Programs]]<br />
This wiki page contains information about various backup programs. It's a good idea to ''have'' regular backups of important data, most notably configuration files ({{Ic|/etc/*}}) and the local pacman database (usually {{Ic|/var/lib/pacman/local/*}}).<br />
<br />
== Introduction ==<br />
Before you start trying various programs out, try to think about your needs, e.g. consider the following questions:<br />
* What backup medium do I have available? (CD, DVD, remote server, external hard drive, etc.)<br />
* How often do I plan to backup? (daily, weekly, monthly, etc.)<br />
* What features do I expect from the backup solution? (compression, encryption, handles renames, etc.)<br />
* How do I plan to restore backups if needed?<br />
<br />
== Incremental backups ==<br />
Applications that can do incremental backups remember and take into account what data has been backed up during the last run and eliminate the need to have duplicates of unchanged data. Restoring the data to a certain point in time would require locating the last full backup and all the incremental backups from then to the moment when it is supposed to be restored. This sort of backup is useful for those who do it very often.<br />
<br />
=== Rsync-type backups ===<br />
The main characteristic of this type of backups is that they maintain a copy of the directory you want to keep a backup of, in a traditional "mirror" fashion.<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe how the contents of files and folders changed from the last backup (so-called 'diffs'). Hence, they are inherently incremental, but usually they do not have compression or encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. A downside to rsync-type programs is that they cannot be easily burned and restored from a CD or DVD.<br />
<br />
==== Console ====<br />
* {{App|[[rsync]]|A file transfer program to keep remote files in sync.<br />
** rsync almost always makes a mirror of the source.<br />
** Impossible to restore a full backup before the most recent backup (but you can use --backup to keep old versions of the files).<br />
** Standard install on all distros.<br />
** Can run over SSH (port 22) or native rsync protocol (port 873).<br />
** Win32 version available.<br />
|http://rsync.samba.org/|{{Pkg|rsync}}}}<br />
<br />
* {{App|[[Wikipedia:Rsync#Variations|rdiff-backup]]|A utility for local/remote mirroring and incremental backups.<br />
** Stores the most recent backup as regular files.<br />
** To revert to older versions, you apply the diff files to recreate the older versions.<br />
** It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change.<br />
** Win32 version available.<br />
|http://www.nongnu.org/rdiff-backup/|{{Pkg|rdiff-backup}}}}<br />
<br />
* {{App|[[rsnapshot]]|A remote filesystem snapshot utility.<br />
** Does not store diffs, instead it copies entire files if they have changed.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
** Destination filesystem must support hard links.<br />
** Win32 version available.<br />
|http://www.rsnapshot.org/|{{Pkg|rsnapshot}}}}<br />
<br />
* {{App|SafeKeep|A client/server backup system which uses rdiff-backup.<br />
** Integrates with Linux LVM and databases to create consistent backups.<br />
** Bandwidth throttling.<br />
|http://safekeep.sourceforge.net/|{{AUR|safekeep}}}}<br />
<br />
* {{App|Link-Backup|A tool similar to rsync based scripts, but which does not use rsync.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer.<br />
** The backup directory contains {{ic|.catalog}}, a catalog of all unique file instances; backup trees hard-link to this catalog.<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script.<br />
** It copies itself to the server; it does not need to be installed on the server.<br />
** Requires SSH for remote backups.<br />
** It resumes stopped backups; it can even be told to run for an arbitrary number of minutes.<br />
|http://www.scottlu.com/Content/Link-Backup.html|{{AUR|link-backup}}}}<br />
<br />
* {{App|[[Wikipedia:Unison (file synchronizer)|Unison]]|A program that synchronizes files between two machines over network (LAN or Inet) using a smart diff method + rsync. Allows the user to interactively choose which changes to push, pull, or merge.|http://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
<br />
* {{App|oldtime|A highly customizable and configurable backup & restore system.|https://github.com/GutenYe/oldtime|{{AUR?|oldtime}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Back In Time|A simple backup tool for Linux inspired by the [[Wikipedia:FlyBack|FlyBack]] and [https://wiki.ubuntu.com/TimeVault/ TimeVault] projects.<br />
** Creates hard links between a series of backed-up trees (snapshots).<br />
** Really is just a front-end to {{ic|rsync}}, {{ic|diff}}, {{ic|cp}}.<br />
** A new snapshot is created only if something changed since the last snapshot.<br />
|http://backintime.le-web.org/|{{AUR|backintime}}}}<br />
<br />
* {{App|[[Wikipedia:FlyBack|FlyBack]]|A clone of Apple's [[Wikipedia:Time Machine (Mac OS)|Time Machine]], a backup utility for Mac OS X.|http://www.flyback-project.org/|{{AUR|flyback}}}}<br />
<br />
* {{App|[[Wikipedia:Areca Backup|Areca Backup]]|An easy to use and reliable backup solution for Linux and Windows.<br />
** Written in Java.<br />
** Primarily archive-based (zip), but will do file-based backup as well.<br />
** Delta backup supported (stores only changes).<br />
|http://areca.sourceforge.net/|{{AUR|areca}}}}<br />
<br />
* {{App|[[Wikipedia:LuckyBackup|luckyBackup]]|An easy program to backup and sync your files.<br />
** It is written in Qt and C++.<br />
** It has sync, backup (with include and exclude options) and restore capabilities.<br />
** It can do remote connection backups, scheduled backups.<br />
** A command line mode.<br />
|http://luckybackup.sourceforge.net/index.html|{{AUR|luckybackup}}}}<br />
<br />
* {{App|syncBackup|A front-end for rsync that provides a fast and extraordinary copying tool. It offers the most common options that control its behavior and permit very flexible specification of the set of files to be copied.<br />
|http://www.darhon.com/syncbackup|{{AUR|syncbackup}}}}<br />
<br />
* {{App|[[BackupPC]]|A high-performance, enterprise-grade system for backing up Unix, Linux, Windows, and Mac OS X desktops and laptops to a remote server.<br />
** Deduplication: Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.<br />
** Optional compression support further reducing disk storage.<br />
** No client-side software is needed.<br />
** Simple but powerful web-based UI.<br />
|http://backuppc.sourceforge.net/index.html|{{Pkg|backuppc}}}}<br />
<br />
=== Other backups ===<br />
Most other backup applications tend to create (big) archive files and (of course) keep track of what's been archived. Creating {{ic|.tar.bz2}} or {{ic|.tar.gz}} archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you do not need to have the backup program around.<br />
<br />
==== Console ====<br />
* {{App|Arch Backup|A trivial backup script with simple configuration.<br />
** Configurable compression method.<br />
** Multiple backup targets.<br />
|http://code.google.com/p/archlinux-stuff/|{{Pkg|arch-backup}}}}<br />
<br />
* {{App|[[Backup with hdup|hdup]]|A very simple command line backup tool.<br />
** Creates tar.gz or tar.bz2 archives.<br />
** Supports gpg encryption.<br />
** Supports pushing over SSH.<br />
** Multiple backup targets.<br />
|http://miek.nl/projects/hdup2/|{{AUR|hdup}}}}<br />
<br />
* {{App|rdup|A platform for backups that provides scripts to facilitate backups and delegates the encryption, compression, transfer and packaging to other utilities in a true Unix-way.<br />
** Creates tar.gz archives or rsync-type copy.<br />
** Encryption (gpg, blowfish and others); also applies for rsync-type copy.<br />
** Compression (also for rsync-type copy).<br />
|http://miek.nl/projects/rdup|{{AUR|rdup}}}}<br />
<br />
* {{App|[[Duplicity]]|A simple command-line utility which allows encrypted compressed incremental backup to nearly any storage.<br />
** Supports gpg encryption and signing.<br />
** Supports gzip compression.<br />
** Supports full or incremental backups, incremental backup stores only difference between new and old file.<br />
** Supports pushing over FTP, SSH, rsync, WebDAV, WebDAVs, HSi and Amazon S3 or local filesystem.<br />
|http://www.nongnu.org/duplicity/|{{Pkg|duplicity}}}}<br />
<br />
* {{App|[[Wikipedia:DAR (Disk Archiver)|DAR]]|A full-featured command-line backup tool, short for Disk ARchive.<br />
** It uses its own format for archives (so you need to have it around when you want to restore).<br />
** Supports splitting backups into more files by size.<br />
** Makefile-type config files, some custom scripts are available along with it.<br />
** Supports basic encryption.<br />
** Automatic backup using [[cron]] is possible with {{AUR|sarab}}.<br />
|http://dar.linux.free.fr/|{{AUR|dar}} {{AUR|kdar}} (fontend)}}<br />
<br />
* {{App|Manent|An algorithmically strong backup and archival program. NOTE: no upstream activity since 2009.<br />
** Efficient backup to anything that looks like a storage.<br />
** Works well over a slow and unreliable network.<br />
** Offers online access to the contents of the backup.<br />
** Backed up storage is completely encrypted.<br />
** Several computers can use the same storage for backup, automatically sharing data.<br />
** Not reliant on timestamps of the remote system to detect changes.<br />
** Cross-platform support for Unicode file names.<br />
|http://code.google.com/p/manent/|{{AUR|manent}}}}<br />
<br />
* {{App|btar|tar-compatible archiver<br />
** Fast archive creation (multicore compression or ciphering)<br />
** Arbitrary chain of compression/ciphers (calls any compression/ciphering programs)<br />
** Indexed archive retrieval or listing<br />
** Redundancy<br />
** Serialization through pipes (and only one file per backup)<br />
** Can be extracted or checked with gnutar<br />
** Differential backups of multiple levels<br />
** Optional encoding of big files with rsync-differences<br />
|http://viric.name/cgi-bin/btar|{{AUR|btar}}}}<br />
<br />
* {{App|obnam|Easy, secure backup program<br />
** Uses snapshots instead of full/incremental backups<br />
|http://liw.fi/obnam/|{{AUR|obnam}}}}<br />
<br />
* {{App|System Tar & Restore|A set of bash scripts for full system backup and restore<br />
** CLI and Dialog interfaces, Zenity wrappers<br />
** Easy backup and restore wizards<br />
** Uses tar to create and restore backups<br />
** Creates tar.gz or tar.xz archives<br />
** Uses rsync to transfer a running system<br />
** Supports Grub2 and Syslinux<br />
|http://code.google.com/p/system-tar-and-restore/|{{AUR|system-tar-and-restore}}}}<br />
<br />
==== Graphical ====<br />
* {{App|Backerupper|A simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** Creates {{ic|.tar.gz}} archives.<br />
** Configurable backup frequency, backup time and max copies.<br />
|http://sourceforge.net/projects/backerupper/|{{AUR|backerupper}}}}<br />
<br />
* {{App|[[Duplicity|Déjà Dup]]|A simple GTK+ backup program. It hides the complexity of doing backups the 'right way' (encrypted, off-site, and regular) and uses duplicity as the backend.<br />
** Automatic, timed backup configurable in GUI.<br />
** Restore wizard.<br />
** Integrated into the Nautilus file manager.<br />
** Inherits several features of duplicity.<br />
|https://launchpad.net/deja-dup|{{Pkg|deja-dup|}}}}<br />
<br />
* {{App|Synkron|A folder synchronization tool.<br />
** Syncs multiple folders.<br />
** Can exclude files from sync based on wildcards.<br />
** Restores files.<br />
** Cross-platform support.<br />
|http://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
<br />
== Cloud backups ==<br />
* {{App|[[Wikipedia:CrashPlan|CrashPlan]]|An online/offsite backup solution.<br />
** Unlimited online space for very reasonable pricing.<br />
** Automatic and incremental backups to multiple destinations.<br />
** Intuitive GUI.<br />
** Offers encryption and de-duplication.<br />
** Software is generally free.<br />
|http://www.crashplan.com/|{{AUR|crashplan}}}}<br />
<br />
* {{App|[[Dropbox]]|A popular file-sharing service.<br />
** A daemon monitors a specified directory, and uploads incremental changes to dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
|http://www.getdropbox.com|{{AUR|dropbox}} {{AUR|nautilus-dropbox}}}}<br />
<br />
* {{App|[[Wikipedia:Jungle Disk|Jungle Disk]]|An online backup tool that stores its data in Amazon S3 or Rackspace Cloud Files.<br />
** A Nautilus extension.<br />
** Only paid plans available.<br />
|http://www.jungledisk.com/|{{AUR|nautilus-jungledisk}}}}<br />
<br />
* {{App|Tarsnap|A secure online backup service for BSD, Linux, OS X, Solaris and Windows (through Cygwin).<br />
** Compressed encrypted backups to Amazon S3 Servers.<br />
** Automate via [[cron]].<br />
** Incremental backups.<br />
** Backup any files or directories.<br />
** Command line only client.<br />
** Pay only for usage (bandwidth and storage). <br />
|http://www.tarsnap.com|{{Pkg|tarsnap}}}}<br />
<br />
* {{App|[[Wikipedia:Wuala|Wuala]]|A secure online storage, file synchronization, versioning and backup service.<br />
** Closed source, free and paid version available.<br />
** Free account holds 5GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
** Social networking features.<br />
** All files in the cloud are first encrypted locally.<br />
|http://www.wuala.com/|{{AUR|wuala}}, {{AUR|wuala-daemon}} &ndash; to run as daemon}}<br />
<br />
* {{App|[[Wikipedia:SpiderOak|SpiderOak]]|An online backup tool for Windows, Mac and Linux users to back up, share, sync, access and store[1] their data.<br />
** Free and paid version available.<br />
** Free account holds 2GB.<br />
** Includes file sharing and a public directory.<br />
** Incremental backup and sync are both supported.<br />
|https://spideroak.com/|{{AUR|spideroak}}}}<br />
<br />
* {{App|[[Ubuntu One]]|An online storage service with sync and sharing across platforms.<br />
** Free and payed versions available.<br />
** Free account with 5GB.<br />
** Mobile access.<br />
** Music streaming.<br />
|https://one.ubuntu.com/services/|{{Pkg|ubuntuone-client}}}}<br />
<br />
* {{App|Packrat|A simple, modular backup system that uses [[Wikipedia:DAR (Disk Archiver)|DAR]] to take full or incremental backups of files and can store them locally, on a remote system via SSH, or on Amazon S3.|http://www.zeroflux.org/projects|{{AUR|packrat}}}}<br />
<br />
== Cooperative storage cloud backups ==<br />
<br />
A [[cooperative storage cloud|Wikipedia:Cooperative_storage_cloud]] is a decentralized model of networked online storage where data is stored on multiple computers, hosted by the participants cooperating in the cloud. <br />
<br />
* {{App|Symform| A peer-to-peer cloud backup service.<br />
** Unlimited free backup in exchange for 2:1 storage space contribution with an always-connected device (at least 80% uptime).<br />
** [http://www.symform.com/our-solutions/pricing/ Payment options exist].<br />
** First 10GB of backup storage is free (no contribution needed).<br />
** In addition to paid support, support plans in exchange for extended contribution (300GB+) exist.<br />
** Automatic and incremental backups.<br />
** Data is encrypted before leaving the computer, though keys are also stored on the Symform's servers.<br />
** Customizable limits for bandwidth consumption.<br />
** Ability to have a local copy ("Hot Copy") of the backed up data on a different disk or computer.<br />
** Ability to have synchronized folders between nodes (Dropbox-like).<br />
|http://www.symform.com/|{{AUR|symform}}}}<br />
<br />
<br />
== Non-incremental backups ==<br />
Another type of backups are those used in case of a disaster. These include application that allow easy backup of entire filesystems and recovery in case of failure, usually in the form of a Live CD or USB drive. The contains complete system images from one or more specific points in time and are frequently used by to record known good configurations.<br />
<br />
* {{App|Q7Z|P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar.<br />
** Updates existing archives quickly.<br />
** Backup multiple folders to a storage location.<br />
** Create or extract protected archives.<br />
** Lessen effort by using archiving profiles and lists.<br />
|http://k7z.sourceforge.net/|{{AUR|q7z}}}}<br />
<br />
* {{App|[[Partclone]]|A tool that can be used to back up and restore a partition while considering only used blocks.<br />
** Supports ext2, ext3, hfs+, reiser3.5, reiser3.6, reiser4, ext4 and btrfs.<br />
** Supports compression.<br />
|http://partclone.nchc.org.tw/trac/|{{AUR|partclone}}}}<br />
<br />
* {{App|[[Wikipedia:Redo Backup and Recovery|Redo Backup and Recovery]]|A backup and disaster recovery application that runs from a bootable Linux CD image.<br />
** Is capable of bare-metal backup and recovery of disk partitions.<br />
** Uses [http://www.xpud.org/ xPUD] and [[Partclone]] for the backend.<br />
|http://www.redobackup.org/|{{AUR?|redobackup}}}}<br />
<br />
* {{App|[[Wikipedia:Clonezilla|Clonezilla]]|A disaster recovery, disk cloning, disk imaging and deployment solution.<br />
** Boots from live CD, USB flash drive, or PXE server.<br />
** Supports ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs, btrfs FAT32, NTFS, HFS+ and others.<br />
** Uses Partclone (default), Partimage (optional), ntfsclone (optional), or dd to image or clone a partition.<br />
** Multicasting server to restore to many machines at once.<br />
|http://clonezilla.org/|{{AUR|clonezilla}}}}<br />
<br />
* {{App|[[Wikipedia:Partimage|Partimage]]|A disk cloning utility for Linux/UNIX environments.<br />
** Has a Live CD.<br />
** Supports the most popular filesystems on Linux, Windows and Mac OS.<br />
** Compression.<br />
** Saving to multiple CDs or DVDs or across a network using Samba/NFS.<br />
|http://www.partimage.org/Main_Page|{{Pkg|partimage}}}}<br />
<br />
* {{App|FSArchiver|A safe and flexible file-system backup and deployment tool<br />
** Support for basic file attributes (permissions, owner, ...).<br />
** Support for multiple file-systems per archive.<br />
** Support for extended attributes (they are used by SELinux).<br />
** Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems.<br />
** Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of a Windows partitions).<br />
** Checksumming of everything which is written in the archive (headers, data blocks, whole files).<br />
** Ability to restore an archive which is corrupt (it will just skip the current file).<br />
** Multi-threaded lzo, gzip, bzip2, lzma compression.<br />
** Support for splitting large archives into several files with a fixed maximum size.<br />
** Encryption of the archive using a password. Based on blowfish from libcrypto from [[OpenSSL]].<br />
** Support backup of a mounted root filesystem (-A option).<br />
|http://www.fsarchiver.org/Main_Page|{{Pkg|fsarchiver}}}}<br />
<br />
* {{App|[[Wikipedia:Mondo Rescue|Mondo Rescue]]|A disaster recovery solution to create backup media that can be used to redeploy the damaged system.<br />
** Image-based backups, supporting Linux/Windows.<br />
** Compression rate is adjustable.<br />
** Can backup live systems (without having to halt it).<br />
** Can split image over many files.<br />
** Supports booting to a Live CD to perform a full restore.<br />
** Can backup/restore over NFS, from CDs, tape drives and and other media.<br />
** Can verify backups.<br />
|http://www.mondorescue.org/|{{AUR|mondo}}}}<br />
<br />
== Versioning systems ==<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
=== Version control systems ===<br />
{{Wikipedia|Comparison of revision control software}}.<br />
<br />
* {{App|[[Git]]|A distributed revision control and source code management system with an emphasis on speed.<br />
** Very easy creation, merging, and deletion of branches.<br />
** Nearly all operations are performed locally, giving it a huge speed advantage on centralized systems.<br />
** Has a "staging area" or "index", this is an intermediate area where commits can be formatted and reviewed before completing the commit.<br />
** Does not handle binary files very well.<br />
|http://git-scm.com/|{{Pkg|git}}}}<br />
<br />
* {{App|[[Subversion]]|A full-featured centralized version control system originally designed to be a better CVS.<br />
** Renamed/copied/moved/removed files retain full revision history.<br />
** Native support for binary files, with space-efficient binary-diff storage.<br />
** Costs proportional to change size, not to data size.<br />
** Allows arbitrary metadata ("properties") to be attached to any file or directory. <br />
|http://subversion.apache.org/|{{Pkg|subversion}}}}<br />
<br />
* {{App|[[Mercurial]]|A distributed version control system written in Python and similar in many ways to Git.<br />
** Platform independent.<br />
** Support for [http://mercurial.selenic.com/wiki/UsingExtensions extensions].<br />
** A set of commands consistent with Subversion.<br />
** Supports tags.<br />
|http://mercurial.selenic.com/|{{Pkg|mercurial}}}}<br />
<br />
* {{App|[[Wikipedia:Bazaar (software)|Bazaar]]|A distributed version control system that helps you track project history over time and to collaborate easily with others.<br />
** Similar commands to Subversion.<br />
** Supports working with or without a central server.<br />
** Support for working with some other revision control systems<br />
** Complete Unicode support.<br />
|http://bazaar.canonical.com/en/|{{Pkg|bzr}}}}<br />
<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|A distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.<br />
** Offline mode.<br />
** Easy branching and merging.<br />
** Written in Haskell.<br />
** Not very fast.<br />
|http://darcs.net/|{{AUR|darcs}}}}<br />
<br />
=== VCS-based backups ===<br />
<br />
* {{App|Gibak|A backup system based on [[Git]].<br />
** Supports binary diffs.<br />
** Uses all of Git's features (such as {{ic|.gitignore}} for filtering files).<br />
** Uses Git's hook system to save information that Git does not (permissions, mtime, empty directories, etc).<br />
|https://github.com/pangloss/gibak|{{AUR|gibak}}}}<br />
* {{App|bup|A fledgling Git-based backup solution written in Python and C.<br />
** Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks.<br />
** Can back up directly to a remote bup server.<br />
** Has an improved index format to allow you to track many files.<br />
|https://github.com/bup/bup|{{AUR|bup}}}}<br />
* {{App|ColdStorage|Another backup tool using Git at its core, written in [[Qt]].|http://gitorious.org/coldstorage|{{AUR|coldstorage-git}}}}<br />
<br />
== External Resources ==<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
* [http://www.askapache.com/security/mirror-using-rsync-ssh.html Mirroring an Entire Site using Rsync over SSH]</div>Chionsashttps://wiki.archlinux.org/index.php?title=Zsh&diff=256103Zsh2013-05-04T20:03:29Z<p>Chionsas: fixed aur package link (using {{AUR|prezto-git}}</p>
<hr />
<div>[[Category:Command shells]]<br />
[[cs:Zsh]]<br />
[[de:Zsh]]<br />
[[fr:Zsh]]<br />
[[zh-CN:Zsh]]<br />
[http://www.zsh.org Zsh] is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. While being compatible with [[Bash]] (not by default, only if you issue "emulate sh"), it offers many advantages such as:<br />
<br />
*Faster<br />
*Improved tab completion<br />
*Improved globbing<br />
*Improved array handling<br />
*Fully customisable<br />
<br />
The Zsh FAQ offers [http://zsh.sourceforge.net/FAQ/zshfaq01.html#l4 more reasons] to use Zsh as your shell.<br />
<br />
==Installation==<br />
<br />
Before starting you may want to see what shell is currently being used:<br />
<br />
$ echo $SHELL<br />
<br />
[[pacman|Install]] the {{Pkg|zsh}} package available in the [[Official Repositories|official repositories]].<br />
<br />
===Initial configuration===<br />
<br />
Make sure that Zsh has been installed correctly by running the following in a terminal:<br />
<br />
$ zsh<br />
<br />
You should now see '''zsh-newuser-install''', which will walk you through some basic configuration. If you want to skip this, press {{Ic|q}}.<br />
<br />
===Making Zsh your default shell===<br />
<br />
If the shell is listed in {{ic|/etc/shells}} you can use the {{Ic|chsh}} command to change your default shell without root access. If you installed Zsh from the [[Official Repositories|official repositories]], it should already have an entry in {{ic|/etc/shells}}. <br />
<br />
Change the default shell for the current user:<br />
<br />
$ chsh -s $(which zsh)<br />
<br />
{{Note|You have to log out and log back in, in order to start using Zsh as your default shell.}}<br />
<br />
After logging back in, you should notice Zsh's prompt, which by default looks different from Bash's. However you can verify that Zsh is the current shell by issuing:<br />
<br />
$ echo $SHELL<br />
<br />
{{Tip|If you are replacing {{Pkg|bash}}, you may want to move some code from {{ic|~/.bashrc}} to {{ic|~/.zshrc}} (e.g. the prompt and the aliases) and from {{ic|~/.bash_profile}} to {{ic|~/.zprofile}} (e.g. [[Start X at Boot|the code that starts your X Window System]]).}}<br />
<br />
==Configuration files==<br />
At login, Zsh sources the following files in this order:<br />
;{{ic|~/.zshenv}}:This file should contain commands to set the command search path, plus other important environment variables; it should not contain commands that produce output or assume the shell is attached to a tty. <br />
;{{ic|/etc/profile}}:This file is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings. <br />
;{{ic|~/.zprofile}}:This file is generally used for automatic execution of user's scripts.<br />
;{{ic|~/.zshrc}}:This is Zsh's main configuration file.<br />
;{{ic|~/.zlogin}}:This file is generally used for automatic execution of user's scripts.<br />
<br />
At logout it sources '''{{ic|~/.zlogout}}''', which is used for automatic execution of user's scripts.<br />
<br />
{{Note|<br />
*The paths used in Arch's {{Pkg|zsh}} package are different from the default ones used in the man pages.<br />
*{{Ic|$ZDOTDIR}} defaults to {{Ic|$HOME}}<br />
*{{ic|/etc/profile}} is not a part of the regular list of startup files run for Zsh, but is sourced from {{ic|/etc/zsh/zprofile}} in the {{Pkg|zsh}} package. Users should take note that {{ic|/etc/profile}} sets the {{ic|$PATH}} variable which will overwrite any {{ic|$PATH}} variable set in {{ic|~/.zshenv}}. To prevent this, either replace the {{ic|/etc/zsh/zprofile}} file with your own, or set your {{ic|$PATH}} variable from {{ic|~/.zshrc}}.<br />
}}<br />
<br />
==~/.zshrc configuration==<br />
<br />
Although Zsh is usable out of the box, it is almost certainly not set up the way you would like to use it, but due to the sheer amount of customisation available in Zsh, configuring Zsh can be a daunting and time-consuming experience.<br />
<br />
Included below is a sample configuration file, it provides a decent set of default options as well as giving examples of many ways that Zsh can be customised. In order to use this configuration save it as a file named {{ic|.zshrc}}. You can then apply the changes without needing to logout and then back in by running:<br />
<br />
$ source ~/.zshrc<br />
<br />
===Simple .zshrc===<br />
<br />
Here is a simple {{ic|.zshrc}}, that should be sufficient to get you started:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U compinit promptinit<br />
compinit<br />
promptinit<br />
<br />
# This will set the default prompt to the walters theme<br />
prompt walters}}<br />
<br />
=== Command Completion ===<br />
Perhaps the most compelling feature of Zsh is its advanced autocompletion abilities. At the very least, you will want to enable autocompletion in your {{ic|.zshrc}}. To enable autocompletion, add the following to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U compinit<br />
compinit}}<br />
<br />
The above configuration includes ssh/scp/sftp hostnames completion but in order for this feature to work you will need to prevent ssh from hashing hosts names in {{ic|~/.ssh/known_hosts}}.<br />
{{Warning|This makes your computer vulnerable to [http://nms.lcs.mit.edu/projects/ssh/README.hashed-hosts "Island-hopping" attacks]. In that intention, comment the following line or set the value to {{ıc|no}}:<br />
{{hc|/etc/ssh/ssh_config|<br />
#HashKnownHosts yes}}<br />
And move your {{ic|~/.ssh/known_hosts}} somewhere else so that ssh creates a new one with un-hashed hostnames (previously known hosts will thus be lost).<br />
}}<br />
<br />
For autocompletion with an arrow-key driven interface, add the following to:<br />
{{hc|~/.zshrc|<br />
zstyle ':completion:*' menu select}}<br />
:''To activate the menu, press tab twice.''<br />
<br />
For autocompletion of command line switches for aliases, add the following to:<br />
{{hc|~/.zshrc|<br />
setopt completealiases}}<br />
<br />
=== The "command not found" hook ===<br />
The [[pkgfile]] package includes a "command not found" hook that will automatically search the [[official repositories]] when you enter an unrecognized command. Then it will display something like this:<br />
<br />
{{hc|$ abiword|<br />
abiword may be found in the following packages:<br />
extra/abiword 2.8.6-7 usr/bin/abiword<br />
}}<br />
<br />
An alternative "command not found" hook is also provided by the AUR package [https://aur.archlinux.org/packages.php?ID=52305 command-not-found], which will generate an output like the following:<br />
<br />
{{hc|$ abiword|<br />
The command 'abiword' is been provided by the following packages:<br />
'''abiword''' (2.8.6-7) from extra<br />
[ abiword ]<br />
'''abiword''' (2.8.6-7) from staging<br />
[ abiword ]<br />
'''abiword''' (2.8.6-7) from testing<br />
[ abiword ]<br />
}}<br />
<br />
for it to work, add the following to a zshrc:<br />
<br />
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh<br />
<br />
=== Key Bindings ===<br />
Zsh does not use readline, instead it uses its own and more powerful zle. It does not read {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}.<br />
zle has an [[emacs]] mode and a [[vi]] mode. By default, it tries to guess whether you want emacs or vi keys from the {{ic|$EDITOR}} environment variable. If it is empty, it will default to emacs. You can change this with {{ic|bindkey -v}} or {{ic|bindkey -e}}.<br />
<br />
To get some special keys working:<br />
{{hc|~/.zshrc|2=<br />
# create a zkbd compatible hash;<br />
# to add other keys to this hash, see: man 5 terminfo<br />
typeset -A key<br />
<br />
key[Home]=${terminfo[khome]}<br />
<br />
key[End]=${terminfo[kend]}<br />
key[Insert]=${terminfo[kich1]}<br />
key[Delete]=${terminfo[kdch1]}<br />
key[Up]=${terminfo[kcuu1]}<br />
key[Down]=${terminfo[kcud1]}<br />
key[Left]=${terminfo[kcub1]}<br />
key[Right]=${terminfo[kcuf1]}<br />
key[PageUp]=${terminfo[kpp]}<br />
key[PageDown]=${terminfo[knp]}<br />
<br />
# setup key accordingly<br />
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line<br />
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line<br />
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode<br />
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char<br />
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history<br />
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history<br />
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char<br />
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char<br />
<br />
# Finally, make sure the terminal is in application mode, when zle is<br />
# active. Only then are the values from $terminfo valid.<br />
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then<br />
function zle-line-init () {<br />
printf '%s' "${terminfo[smkx]}"<br />
}<br />
function zle-line-finish () {<br />
printf '%s' "${terminfo[rmkx]}"<br />
}<br />
zle -N zle-line-init<br />
zle -N zle-line-finish<br />
fi<br />
}}<br />
<br />
{{Note|To get the proper sequences for certain key combinations, start {{Ic|cat}} or {{Ic|read}} without any parameters and press them; they should then be printed in the terminal. Both can be closed again via {{Keypress|Ctrl+C}}.}}<br />
<br />
===History search===<br />
You can add these lines to your .zshrc<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward<br />
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward<br />
</nowiki>}}<br />
<br />
Doing this, only past commands beginning with the current input would have been shown.<br />
<br />
===Prompts===<br />
<br />
There is a quick and easy way to set up a colored prompt in Zsh. Make sure that prompt is set to autoload in your {{ic|.zshrc}}. This can be done by adding these lines to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U promptinit<br />
promptinit<br />
}}<br />
<br />
You can now see available prompts by running the command:<br />
<br />
$ prompt -l<br />
<br />
To try one of the commands that is listed, use the command prompt followed by the name of the prompt you like. For example, to use the {{ic|walters}} prompt, you would enter:<br />
<br />
$ prompt walters<br />
<br />
===Customizing your prompt===<br />
<br />
In case you are dissatisfied with the prompts mentioned above(or want to expand their usefulness), zsh offers the possibility to build your own custom prompt. Zsh supports a left- and right-sided prompt additional to the single, left-sided prompt that is common to all shells. You can customize it by using {{ic|1=PROMPT=}} with the following variables:<br />
<br />
====Prompt variables====<br />
=====General=====<br />
; %n : The username<br />
; %m : The computer's hostname(truncated to the first period)<br />
; %M : The computer's hostname<br />
; %l : The current tty<br />
; %? : The return code of the last-run application.<br />
; %# : The prompt based on user privileges ({{Ic|#}} for root and {{Ic|%}} for the rest)<br />
<br />
=====Times=====<br />
; %T : System time(HH:MM)<br />
; %* : System time(HH:MM:SS)<br />
; %D : System date(YY-MM-DD)<br />
<br />
=====Directories=====<br />
; %~ : The current working directory. If you are in you are in your {{ic|$HOME}}, this will be replaced by {{ic|~}}.<br />
; %d : The current working directory.<br />
<br />
For the options mentioned above: You can prefix an integer to show only certain parts of your working path. If you entered {{Ic|%1d}} and found yourself in {{Ic|/usr/bin}} it would show {{Ic|bin}}. This can also be done with negative integers:<br />
{{Ic|%-1d}} using the same directory as above would show {{Ic|/}}.<br />
<br />
=====Formatting=====<br />
; %U [...] %u : Begin and end underlined print<br />
; %B [...] %b : Begin and end bold print<br />
; %{ [...] %} : Begin and enter area that will not be printed. Useful for setting colors.<br />
:In fact, this tag forces Zsh to ignore anything inside them when making indents for the prompt as well.<br />
:As such, not to use it can have some weird effects on the margins and indentation of the prompt.<br />
<br />
=====Colors=====<br />
Zsh has a different approach to setting colors on the terminal than the one depicted [https://wiki.archlinux.org/index.php/Color_Bash_Prompt here]. First you write before {{ic|1=PROMPT=}} in your {{Ic|.zshrc}}:<br />
autoload -U colors && colors<br />
<br />
Following commands would now produce the color escape sequence needed to set the requested color when the prompt is printed:<br />
; $fg[color] : will set the text color (red, green, blue, etc. - defaults to bold)<br />
; $fg_no_bold[color]: will set the non-bold text color<br />
; $fg_bold[color]: will set the bold text color <br />
; $reset_color : will reset the text color to white<br />
It is useful to put these color commands inside {{Ic|%{ [...] %} }}, so the shell knows there is no output from these sequences and the cursor hasn't moved.<br />
<br />
;Possible color values<br />
{| border="1"<br />
|-<br />
|black || red<br />
|-<br />
|green || yellow<br />
|-<br />
|blue || magenta<br />
|-<br />
|cyan || white<br />
|-<br />
|}<br />
Note that bold text doesn't necessarily use the same colors as normal text. For example, $fg['yellow'] looks brown or a very dark yellow, while $fg_no_bold['yellow'] looks like bright or regular yellow.<br />
<br />
====Example====<br />
To have a two-sided prompt you could write:<br />
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg_no_bold[yellow]%}%1~ %{$reset_color%}%#"<br />
RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"<br />
<br />
It would equal(without colors):<br />
username@host ~ % [0]<br />
<br />
===Sample .zshrc files===<br />
<br />
Here is a list of {{ic|.zshrc}} files. Feel free to add your own:<br />
<br />
* [https://github.com/sorin-ionescu/prezto Prezto - Instantly Awesome Zsh] (AUR package: {{AUR|prezto-git}}) is a configuration framework for Zsh. It comes with modules, enriching the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.<br />
* [https://github.com/robbyrussell/oh-my-zsh Oh-my-zsh Plugin and Theme system for Zsh] can help you manage your zshrc file and has a huge community of over 2000 forks on github;<br />
* Basic setup, with dynamic prompt and window title/hardinfo => http://github.com/MrElendig/dotfiles-alice/blob/master/.zshrc;<br />
* An Arch package named [https://www.archlinux.org/packages/extra/any/grml-zsh-config/ grml-zsh-config] comes from http://grml.org/zsh and provides a zshrc file that includes many tweaks for your zshell.<br />
* https://github.com/slashbeast/things/blob/master/configs/DOTzshrc - zshrc with multiple features, be sure to check out comments into it. Notable features: confirm function to ensure that user wnat to run poweroff, reboot or hibernate, support for GIT in prompt (done without vcsinfo), tab completion with menu, printing current executed command into window's title bar and more.<br />
<br />
==Global configuration==<br />
Occasionally you might want to have some settings applied globally to all zsh users. The zsh wiki tells us that there are some global configuration files, for example {{ic|/etc/zshrc}}. This however is slightly different on ArchLinux, since it has been compiled with flags specifically to target {{ic|/etc/zsh/}} instead.<br />
<br />
So, for global configuration use {{ic|/etc/zsh/zshrc}}, not {{ic|/etc/zshrc}}. The same goes for {{ic|/etc/zsh/zshenv}}, {{ic|/etc/zsh/zlogin}} and {{ic|/etc/zsh/zlogout}}. Note that these files are not installed by default, so you need to create them yourself if you want to use them.<br />
<br />
The only exception is zprofile, use {{ic|/etc/profile}} instead.<br />
<br />
===Autostarting applications===<br />
Zsh always executes {{ic|/etc/zsh/zshenv}} and {{ic|$ZDOTDIR/.zshenv}} so do not bloat these files.<br />
<br />
If the shell is a login shell, commands are read from {{ic|/etc/profile}} and then {{ic|$ZDOTDIR/.zprofile}}. Then, if the shell is interactive, commands are read from {{ic|/etc/zsh/zshrc}} and then {{ic|$ZDOTDIR/.zshrc}}. Finally, if the shell is a login shell, {{ic|/etc/zsh/zlogin}} and {{ic|$ZDOTDIR/.zlogin}} are read.<br />
<br />
==Uninstallation==<br />
If you decide that Zsh is not the shell for you and you want to return to Bash, you must first change the default shell, before removing the Zsh package.<br />
<br />
{{Warning| Failure to follow the below procedures will result in all kinds of problems.}}<br />
<br />
Paste the following command in terminal as root:<br />
# chsh -s /bin/bash user<br />
Use it for every user using Zsh.<br />
<br />
Now you can safely remove the Zsh package.<br />
<br />
If you did not follow the above, you can still change the default shell back to Bash by editing {{ic|/etc/passwd}} as root. <br />
<br />
{{Warning| It is '''strongly''' recommended to use vipw when editing user information as it prevents badly formatted entries.}}<br />
<br />
For example: <br />
<br />
from:<br />
username:x:1000:1000:Full Name,,,:/home/username:/bin/zsh<br />
to:<br />
username:x:1000:1000:Full Name,,,:/home/username:/bin/bash<br />
<br />
==See also==<br />
*[http://zsh.sourceforge.net/Intro/intro_1.html#SEC1 Zsh Introduction]<br />
*[http://zsh.sourceforge.net/Guide/zshguide.html Users Guide]<br />
*[http://zsh.sourceforge.net/Doc/Release/index-frame.html Zsh Docs] (you can choose a different format for the doc in http://zsh.sourceforge.net/Doc/)<br />
*[http://zsh.sourceforge.net/FAQ/zshfaq01.html Zsh FAQ]<br />
*[http://zshwiki.org/home/ Zsh Wiki]<br />
*[http://grml.org/zsh/zsh-lovers.html Zsh-lovers]<br />
*[http://www.bash2zsh.com/zsh_refcard/refcard.pdf Bash2Zsh Reference Card]<br />
*[https://github.com/robbyrussell/oh-my-zsh Oh My Zshell by Robby Russell] <br />
*[http://www.gentoo.org/doc/en/zsh.xml Gentoo Linux Documentation -- zsh Configuration and Installation Guide]<br />
*[http://my.opera.com/blackbelt_jones/blog/2007/06/05/zsh-prompt-configuration-issue-solved Setting up the zsh prompt]<br />
<br />
*'''IRC channel''': #zsh at irc.freenode.org</div>Chionsashttps://wiki.archlinux.org/index.php?title=Zsh&diff=256000Zsh2013-05-03T19:46:48Z<p>Chionsas: Added a link to AUR package for Prezto.</p>
<hr />
<div>[[Category:Command shells]]<br />
[[cs:Zsh]]<br />
[[de:Zsh]]<br />
[[fr:Zsh]]<br />
[[zh-CN:Zsh]]<br />
[http://www.zsh.org Zsh] is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. While being compatible with [[Bash]] (not by default, only if you issue "emulate sh"), it offers many advantages such as:<br />
<br />
*Faster<br />
*Improved tab completion<br />
*Improved globbing<br />
*Improved array handling<br />
*Fully customisable<br />
<br />
The Zsh FAQ offers [http://zsh.sourceforge.net/FAQ/zshfaq01.html#l4 more reasons] to use Zsh as your shell.<br />
<br />
==Installation==<br />
<br />
Before starting you may want to see what shell is currently being used:<br />
<br />
$ echo $SHELL<br />
<br />
[[pacman|Install]] the {{Pkg|zsh}} package available in the [[Official Repositories|official repositories]].<br />
<br />
===Initial configuration===<br />
<br />
Make sure that Zsh has been installed correctly by running the following in a terminal:<br />
<br />
$ zsh<br />
<br />
You should now see '''zsh-newuser-install''', which will walk you through some basic configuration. If you want to skip this, press {{Ic|q}}.<br />
<br />
===Making Zsh your default shell===<br />
<br />
If the shell is listed in {{ic|/etc/shells}} you can use the {{Ic|chsh}} command to change your default shell without root access. If you installed Zsh from the [[Official Repositories|official repositories]], it should already have an entry in {{ic|/etc/shells}}. <br />
<br />
Change the default shell for the current user:<br />
<br />
$ chsh -s $(which zsh)<br />
<br />
{{Note|You have to log out and log back in, in order to start using Zsh as your default shell.}}<br />
<br />
After logging back in, you should notice Zsh's prompt, which by default looks different from Bash's. However you can verify that Zsh is the current shell by issuing:<br />
<br />
$ echo $SHELL<br />
<br />
{{Tip|If you are replacing {{Pkg|bash}}, you may want to move some code from {{ic|~/.bashrc}} to {{ic|~/.zshrc}} (e.g. the prompt and the aliases) and from {{ic|~/.bash_profile}} to {{ic|~/.zprofile}} (e.g. [[Start X at Boot|the code that starts your X Window System]]).}}<br />
<br />
==Configuration files==<br />
At login, Zsh sources the following files in this order:<br />
;{{ic|~/.zshenv}}:This file should contain commands to set the command search path, plus other important environment variables; it should not contain commands that produce output or assume the shell is attached to a tty. <br />
;{{ic|/etc/profile}}:This file is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings. <br />
;{{ic|~/.zprofile}}:This file is generally used for automatic execution of user's scripts.<br />
;{{ic|~/.zshrc}}:This is Zsh's main configuration file.<br />
;{{ic|~/.zlogin}}:This file is generally used for automatic execution of user's scripts.<br />
<br />
At logout it sources '''{{ic|~/.zlogout}}''', which is used for automatic execution of user's scripts.<br />
<br />
{{Note|<br />
*The paths used in Arch's {{Pkg|zsh}} package are different from the default ones used in the man pages.<br />
*{{Ic|$ZDOTDIR}} defaults to {{Ic|$HOME}}<br />
*{{ic|/etc/profile}} is not a part of the regular list of startup files run for Zsh, but is sourced from {{ic|/etc/zsh/zprofile}} in the {{Pkg|zsh}} package. Users should take note that {{ic|/etc/profile}} sets the {{ic|$PATH}} variable which will overwrite any {{ic|$PATH}} variable set in {{ic|~/.zshenv}}. To prevent this, either replace the {{ic|/etc/zsh/zprofile}} file with your own, or set your {{ic|$PATH}} variable from {{ic|~/.zshrc}}.<br />
}}<br />
<br />
==~/.zshrc configuration==<br />
<br />
Although Zsh is usable out of the box, it is almost certainly not set up the way you would like to use it, but due to the sheer amount of customisation available in Zsh, configuring Zsh can be a daunting and time-consuming experience.<br />
<br />
Included below is a sample configuration file, it provides a decent set of default options as well as giving examples of many ways that Zsh can be customised. In order to use this configuration save it as a file named {{ic|.zshrc}}. You can then apply the changes without needing to logout and then back in by running:<br />
<br />
$ source ~/.zshrc<br />
<br />
===Simple .zshrc===<br />
<br />
Here is a simple {{ic|.zshrc}}, that should be sufficient to get you started:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U compinit promptinit<br />
compinit<br />
promptinit<br />
<br />
# This will set the default prompt to the walters theme<br />
prompt walters}}<br />
<br />
=== Command Completion ===<br />
Perhaps the most compelling feature of Zsh is its advanced autocompletion abilities. At the very least, you will want to enable autocompletion in your {{ic|.zshrc}}. To enable autocompletion, add the following to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U compinit<br />
compinit}}<br />
<br />
The above configuration includes ssh/scp/sftp hostnames completion but in order for this feature to work you will need to prevent ssh from hashing hosts names in {{ic|~/.ssh/known_hosts}}.<br />
{{Warning|This makes your computer vulnerable to [http://nms.lcs.mit.edu/projects/ssh/README.hashed-hosts "Island-hopping" attacks]. In that intention, comment the following line or set the value to {{ıc|no}}:<br />
{{hc|/etc/ssh/ssh_config|<br />
#HashKnownHosts yes}}<br />
And move your {{ic|~/.ssh/known_hosts}} somewhere else so that ssh creates a new one with un-hashed hostnames (previously known hosts will thus be lost).<br />
}}<br />
<br />
For autocompletion with an arrow-key driven interface, add the following to:<br />
{{hc|~/.zshrc|<br />
zstyle ':completion:*' menu select}}<br />
:''To activate the menu, press tab twice.''<br />
<br />
For autocompletion of command line switches for aliases, add the following to:<br />
{{hc|~/.zshrc|<br />
setopt completealiases}}<br />
<br />
=== The "command not found" hook ===<br />
The [[pkgfile]] package includes a "command not found" hook that will automatically search the [[official repositories]] when you enter an unrecognized command. Then it will display something like this:<br />
<br />
{{hc|$ abiword|<br />
abiword may be found in the following packages:<br />
extra/abiword 2.8.6-7 usr/bin/abiword<br />
}}<br />
<br />
An alternative "command not found" hook is also provided by the AUR package [https://aur.archlinux.org/packages.php?ID=52305 command-not-found], which will generate an output like the following:<br />
<br />
{{hc|$ abiword|<br />
The command 'abiword' is been provided by the following packages:<br />
'''abiword''' (2.8.6-7) from extra<br />
[ abiword ]<br />
'''abiword''' (2.8.6-7) from staging<br />
[ abiword ]<br />
'''abiword''' (2.8.6-7) from testing<br />
[ abiword ]<br />
}}<br />
<br />
for it to work, add the following to a zshrc:<br />
<br />
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh<br />
<br />
=== Key Bindings ===<br />
Zsh does not use readline, instead it uses its own and more powerful zle. It does not read {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}.<br />
zle has an [[emacs]] mode and a [[vi]] mode. By default, it tries to guess whether you want emacs or vi keys from the {{ic|$EDITOR}} environment variable. If it is empty, it will default to emacs. You can change this with {{ic|bindkey -v}} or {{ic|bindkey -e}}.<br />
<br />
To get some special keys working:<br />
{{hc|~/.zshrc|2=<br />
# create a zkbd compatible hash;<br />
# to add other keys to this hash, see: man 5 terminfo<br />
typeset -A key<br />
<br />
key[Home]=${terminfo[khome]}<br />
<br />
key[End]=${terminfo[kend]}<br />
key[Insert]=${terminfo[kich1]}<br />
key[Delete]=${terminfo[kdch1]}<br />
key[Up]=${terminfo[kcuu1]}<br />
key[Down]=${terminfo[kcud1]}<br />
key[Left]=${terminfo[kcub1]}<br />
key[Right]=${terminfo[kcuf1]}<br />
key[PageUp]=${terminfo[kpp]}<br />
key[PageDown]=${terminfo[knp]}<br />
<br />
# setup key accordingly<br />
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line<br />
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line<br />
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode<br />
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char<br />
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history<br />
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history<br />
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char<br />
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char<br />
<br />
# Finally, make sure the terminal is in application mode, when zle is<br />
# active. Only then are the values from $terminfo valid.<br />
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then<br />
function zle-line-init () {<br />
printf '%s' "${terminfo[smkx]}"<br />
}<br />
function zle-line-finish () {<br />
printf '%s' "${terminfo[rmkx]}"<br />
}<br />
zle -N zle-line-init<br />
zle -N zle-line-finish<br />
fi<br />
}}<br />
<br />
{{Note|To get the proper sequences for certain key combinations, start {{Ic|cat}} or {{Ic|read}} without any parameters and press them; they should then be printed in the terminal. Both can be closed again via {{Keypress|Ctrl+C}}.}}<br />
<br />
===History search===<br />
You can add these lines to your .zshrc<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward<br />
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward<br />
</nowiki>}}<br />
<br />
Doing this, only past commands beginning with the current input would have been shown.<br />
<br />
===Prompts===<br />
<br />
There is a quick and easy way to set up a colored prompt in Zsh. Make sure that prompt is set to autoload in your {{ic|.zshrc}}. This can be done by adding these lines to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U promptinit<br />
promptinit<br />
}}<br />
<br />
You can now see available prompts by running the command:<br />
<br />
$ prompt -l<br />
<br />
To try one of the commands that is listed, use the command prompt followed by the name of the prompt you like. For example, to use the {{ic|walters}} prompt, you would enter:<br />
<br />
$ prompt walters<br />
<br />
===Customizing your prompt===<br />
<br />
In case you are dissatisfied with the prompts mentioned above(or want to expand their usefulness), zsh offers the possibility to build your own custom prompt. Zsh supports a left- and right-sided prompt additional to the single, left-sided prompt that is common to all shells. You can customize it by using {{ic|1=PROMPT=}} with the following variables:<br />
<br />
====Prompt variables====<br />
=====General=====<br />
; %n : The username<br />
; %m : The computer's hostname(truncated to the first period)<br />
; %M : The computer's hostname<br />
; %l : The current tty<br />
; %? : The return code of the last-run application.<br />
; %# : The prompt based on user privileges ({{Ic|#}} for root and {{Ic|%}} for the rest)<br />
<br />
=====Times=====<br />
; %T : System time(HH:MM)<br />
; %* : System time(HH:MM:SS)<br />
; %D : System date(YY-MM-DD)<br />
<br />
=====Directories=====<br />
; %~ : The current working directory. If you are in you are in your {{ic|$HOME}}, this will be replaced by {{ic|~}}.<br />
; %d : The current working directory.<br />
<br />
For the options mentioned above: You can prefix an integer to show only certain parts of your working path. If you entered {{Ic|%1d}} and found yourself in {{Ic|/usr/bin}} it would show {{Ic|bin}}. This can also be done with negative integers:<br />
{{Ic|%-1d}} using the same directory as above would show {{Ic|/}}.<br />
<br />
=====Formatting=====<br />
; %U [...] %u : Begin and end underlined print<br />
; %B [...] %b : Begin and end bold print<br />
; %{ [...] %} : Begin and enter area that will not be printed. Useful for setting colors.<br />
:In fact, this tag forces Zsh to ignore anything inside them when making indents for the prompt as well.<br />
:As such, not to use it can have some weird effects on the margins and indentation of the prompt.<br />
<br />
=====Colors=====<br />
Zsh has a different approach to setting colors on the terminal than the one depicted [https://wiki.archlinux.org/index.php/Color_Bash_Prompt here]. First you write before {{ic|1=PROMPT=}} in your {{Ic|.zshrc}}:<br />
autoload -U colors && colors<br />
<br />
Following commands would now produce the color escape sequence needed to set the requested color when the prompt is printed:<br />
; $fg[color] : will set the text color (red, green, blue, etc. - defaults to bold)<br />
; $fg_no_bold[color]: will set the non-bold text color<br />
; $fg_bold[color]: will set the bold text color <br />
; $reset_color : will reset the text color to white<br />
It is useful to put these color commands inside {{Ic|%{ [...] %} }}, so the shell knows there is no output from these sequences and the cursor hasn't moved.<br />
<br />
;Possible color values<br />
{| border="1"<br />
|-<br />
|black || red<br />
|-<br />
|green || yellow<br />
|-<br />
|blue || magenta<br />
|-<br />
|cyan || white<br />
|-<br />
|}<br />
Note that bold text doesn't necessarily use the same colors as normal text. For example, $fg['yellow'] looks brown or a very dark yellow, while $fg_no_bold['yellow'] looks like bright or regular yellow.<br />
<br />
====Example====<br />
To have a two-sided prompt you could write:<br />
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg_no_bold[yellow]%}%1~ %{$reset_color%}%#"<br />
RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"<br />
<br />
It would equal(without colors):<br />
username@host ~ % [0]<br />
<br />
===Sample .zshrc files===<br />
<br />
Here is a list of {{ic|.zshrc}} files. Feel free to add your own:<br />
<br />
* [https://github.com/sorin-ionescu/prezto Prezto - Instantly Awesome Zsh] ([https://aur.archlinux.org/packages/prezto-git/ AUR package]) is a configuration framework for Zsh. It comes with modules, enriching the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.<br />
* [https://github.com/robbyrussell/oh-my-zsh Oh-my-zsh Plugin and Theme system for Zsh] can help you manage your zshrc file and has a huge community of over 2000 forks on github;<br />
* Basic setup, with dynamic prompt and window title/hardinfo => http://github.com/MrElendig/dotfiles-alice/blob/master/.zshrc;<br />
* An Arch package named [https://www.archlinux.org/packages/extra/any/grml-zsh-config/ grml-zsh-config] comes from http://grml.org/zsh and provides a zshrc file that includes many tweaks for your zshell.<br />
* https://github.com/slashbeast/things/blob/master/configs/DOTzshrc - zshrc with multiple features, be sure to check out comments into it. Notable features: confirm function to ensure that user wnat to run poweroff, reboot or hibernate, support for GIT in prompt (done without vcsinfo), tab completion with menu, printing current executed command into window's title bar and more.<br />
<br />
==Global configuration==<br />
Occasionally you might want to have some settings applied globally to all zsh users. The zsh wiki tells us that there are some global configuration files, for example {{ic|/etc/zshrc}}. This however is slightly different on ArchLinux, since it has been compiled with flags specifically to target {{ic|/etc/zsh/}} instead.<br />
<br />
So, for global configuration use {{ic|/etc/zsh/zshrc}}, not {{ic|/etc/zshrc}}. The same goes for {{ic|/etc/zsh/zshenv}}, {{ic|/etc/zsh/zlogin}} and {{ic|/etc/zsh/zlogout}}. Note that these files are not installed by default, so you need to create them yourself if you want to use them.<br />
<br />
The only exception is zprofile, use {{ic|/etc/profile}} instead.<br />
<br />
===Autostarting applications===<br />
Zsh always executes {{ic|/etc/zsh/zshenv}} and {{ic|$ZDOTDIR/.zshenv}} so do not bloat these files.<br />
<br />
If the shell is a login shell, commands are read from {{ic|/etc/profile}} and then {{ic|$ZDOTDIR/.zprofile}}. Then, if the shell is interactive, commands are read from {{ic|/etc/zsh/zshrc}} and then {{ic|$ZDOTDIR/.zshrc}}. Finally, if the shell is a login shell, {{ic|/etc/zsh/zlogin}} and {{ic|$ZDOTDIR/.zlogin}} are read.<br />
<br />
==Uninstallation==<br />
If you decide that Zsh is not the shell for you and you want to return to Bash, you must first change the default shell, before removing the Zsh package.<br />
<br />
{{Warning| Failure to follow the below procedures will result in all kinds of problems.}}<br />
<br />
Paste the following command in terminal as root:<br />
# chsh -s /bin/bash user<br />
Use it for every user using Zsh.<br />
<br />
Now you can safely remove the Zsh package.<br />
<br />
If you did not follow the above, you can still change the default shell back to Bash by editing {{ic|/etc/passwd}} as root. <br />
<br />
{{Warning| It is '''strongly''' recommended to use vipw when editing user information as it prevents badly formatted entries.}}<br />
<br />
For example: <br />
<br />
from:<br />
username:x:1000:1000:Full Name,,,:/home/username:/bin/zsh<br />
to:<br />
username:x:1000:1000:Full Name,,,:/home/username:/bin/bash<br />
<br />
==See also==<br />
*[http://zsh.sourceforge.net/Intro/intro_1.html#SEC1 Zsh Introduction]<br />
*[http://zsh.sourceforge.net/Guide/zshguide.html Users Guide]<br />
*[http://zsh.sourceforge.net/Doc/Release/index-frame.html Zsh Docs] (you can choose a different format for the doc in http://zsh.sourceforge.net/Doc/)<br />
*[http://zsh.sourceforge.net/FAQ/zshfaq01.html Zsh FAQ]<br />
*[http://zshwiki.org/home/ Zsh Wiki]<br />
*[http://grml.org/zsh/zsh-lovers.html Zsh-lovers]<br />
*[http://www.bash2zsh.com/zsh_refcard/refcard.pdf Bash2Zsh Reference Card]<br />
*[https://github.com/robbyrussell/oh-my-zsh Oh My Zshell by Robby Russell] <br />
*[http://www.gentoo.org/doc/en/zsh.xml Gentoo Linux Documentation -- zsh Configuration and Installation Guide]<br />
*[http://my.opera.com/blackbelt_jones/blog/2007/06/05/zsh-prompt-configuration-issue-solved Setting up the zsh prompt]<br />
<br />
*'''IRC channel''': #zsh at irc.freenode.org</div>Chionsashttps://wiki.archlinux.org/index.php?title=Zsh&diff=250978Zsh2013-03-17T00:13:23Z<p>Chionsas: Added https://github.com/sorin-ionescu/prezto to a list of .zshrc resources. It seems to be the best Zsh config framework quality-wise and does not trail behind in features compared with oh-my-zsh.</p>
<hr />
<div>[[Category:Command shells]]<br />
[[cs:Zsh]]<br />
[[de:Zsh]]<br />
[[fr:Zsh]]<br />
[[zh-CN:Zsh]]<br />
[http://www.zsh.org Zsh] is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. While being compatible with [[Bash]] (not by default, only if you issue "emulate sh"), it offers many advantages such as:<br />
<br />
*Faster<br />
*Improved tab completion<br />
*Improved globbing<br />
*Improved array handling<br />
*Fully customisable<br />
<br />
The Zsh FAQ offers [http://zsh.sourceforge.net/FAQ/zshfaq01.html#l4 more reasons] to use Zsh as your shell.<br />
<br />
==Installation==<br />
<br />
Before starting you may want to see what shell is currently being used:<br />
<br />
$ echo $SHELL<br />
<br />
[[pacman|Install]] the {{Pkg|zsh}} package available in the [[Official Repositories|official repositories]].<br />
<br />
===Initial configuration===<br />
<br />
Make sure that Zsh has been installed correctly by running the following in a terminal:<br />
<br />
$ zsh<br />
<br />
You should now see '''zsh-newuser-install''', which will walk you through some basic configuration. If you want to skip this, press {{Ic|q}}.<br />
<br />
===Making Zsh your default shell===<br />
<br />
If the shell is listed in {{ic|/etc/shells}} you can use the {{Ic|chsh}} command to change your default shell without root access. If you installed Zsh from the [[Official Repositories|official repositories]], it should already have an entry in {{ic|/etc/shells}}. <br />
<br />
Change the default shell for the current user:<br />
<br />
$ chsh -s $(which zsh)<br />
<br />
{{Note|You have to log out and log back in, in order to start using Zsh as your default shell.}}<br />
<br />
After logging back in, you should notice Zsh's prompt, which by default looks different from Bash's. However you can verify that Zsh is the current shell by issuing:<br />
<br />
$ echo $SHELL<br />
<br />
{{Tip|If you are replacing {{Pkg|bash}}, you may want to move some code from {{ic|~/.bashrc}} to {{ic|~/.zshrc}} (e.g. the prompt and the aliases) and from {{ic|~/.bash_profile}} to {{ic|~/.zprofile}} (e.g. [[Start X at Boot|the code that starts your X Window System]]).}}<br />
<br />
==Configuration files==<br />
At login, Zsh sources the following files in this order:<br />
;{{ic|~/.zshenv}}:This file should contain commands to set the command search path, plus other important environment variables; it should not contain commands that produce output or assume the shell is attached to a tty. <br />
;{{ic|/etc/profile}}:This file is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings. <br />
;{{ic|~/.zprofile}}:This file is generally used for automatic execution of user's scripts.<br />
;{{ic|~/.zshrc}}:This is Zsh's main configuration file.<br />
;{{ic|~/.zlogin}}:This file is generally used for automatic execution of user's scripts.<br />
<br />
At logout it sources '''{{ic|~/.zlogout}}''', which is used for automatic execution of user's scripts.<br />
<br />
{{Note|<br />
*The paths used in Arch's {{Pkg|zsh}} package are different from the default ones used in the man pages.<br />
*{{Ic|$ZDOTDIR}} defaults to {{Ic|$HOME}}<br />
*{{ic|/etc/profile}} is not a part of the regular list of startup files run for Zsh, but is sourced from {{ic|/etc/zsh/zprofile}} in the {{Pkg|zsh}} package. Users should take note that {{ic|/etc/profile}} sets the {{ic|$PATH}} variable which will overwrite any {{ic|$PATH}} variable set in {{ic|~/.zshenv}}. To prevent this, either replace the {{ic|/etc/zsh/zprofile}} file with your own, or set your {{ic|$PATH}} variable from {{ic|~/.zshrc}}.<br />
}}<br />
<br />
==~/.zshrc configuration==<br />
<br />
Although Zsh is usable out of the box, it is almost certainly not set up the way you would like to use it, but due to the sheer amount of customisation available in Zsh, configuring Zsh can be a daunting and time-consuming experience.<br />
<br />
Included below is a sample configuration file, it provides a decent set of default options as well as giving examples of many ways that Zsh can be customised. In order to use this configuration save it as a file named {{ic|.zshrc}}. You can then apply the changes without needing to logout and then back in by running:<br />
<br />
$ source ~/.zshrc<br />
<br />
===Simple .zshrc===<br />
<br />
Here is a simple {{ic|.zshrc}}, that should be sufficient to get you started:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U compinit promptinit<br />
compinit<br />
promptinit<br />
<br />
# This will set the default prompt to the walters theme<br />
prompt walters}}<br />
<br />
=== Command Completion ===<br />
Perhaps the most compelling feature of Zsh is its advanced autocompletion abilities. At the very least, you will want to enable autocompletion in your {{ic|.zshrc}}. To enable autocompletion, add the following to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U compinit<br />
compinit}}<br />
<br />
The above configuration includes ssh/scp/sftp hostnames completion but in order for this feature to work you will need to prevent ssh from hashing hosts names in {{ic|~/.ssh/known_hosts}}.<br />
{{Warning|This makes your computer vulnerable to [http://nms.lcs.mit.edu/projects/ssh/README.hashed-hosts "Island-hopping" attacks]. In that intention, comment the following line or set the value to {{ıc|no}}:<br />
{{hc|/etc/ssh/ssh_config|<br />
#HashKnownHosts yes}}<br />
And move your {{ic|~/.ssh/known_hosts}} somewhere else so that ssh creates a new one with un-hashed hostnames (previously known hosts will thus be lost).<br />
}}<br />
<br />
For autocompletion with an arrow-key driven interface, add the following to:<br />
{{hc|~/.zshrc|<br />
zstyle ':completion:*' menu select}}<br />
:''To activate the menu, press tab twice.''<br />
<br />
For autocompletion of command line switches for aliases, add the following to:<br />
{{hc|~/.zshrc|<br />
setopt completealiases}}<br />
<br />
=== The "command not found" hook ===<br />
The [[pkgfile]] package includes a "command not found" hook that will automatically search the [[official repositories]] when you enter an unrecognized command. Then it will display something like this:<br />
<div style="font-family: monospace; white-space: pre; overflow: auto; margin: 1em 3em; padding: 1em; border: 3px solid #bcd; background-color: black; color: #aaa;"><span style="color: #0a0">chiri</span> <span style="color: #00f">~/docs</span> <span style="color: #0f0">$</span> abiword<nowiki><br />
abiword may be found in the following packages:<br />
extra/abiword 2.8.6-7 usr/bin/abiword<br />
</nowiki><span style="color: #0a0">chiri</span> <span style="color: #00f">~/docs</span> <span style="color: #0f0">$</span> <span style="text-decoration: blink;">_</span></div><br />
<br />
An alternative "command not found" hook is also provided by the AUR package [https://aur.archlinux.org/packages.php?ID=52305 command-not-found], which will generate an output like the following:<br />
<br />
<div style="font-family: monospace; white-space: pre; overflow: auto; margin: 1em 3em; padding: 1em; border: 3px solid #bcd; background-color: black; color: #aaa;"><span style="color: #0a0">chiri</span> <span style="color: #00f">~/docs</span> <span style="color: #0f0">$</span> abiword<br />
The command 'abiword' is been provided by the following packages:<br />
<span style="font-weight: bold">abiword</span> (2.8.6-7) from extra<nowiki><br />
</nowiki>[ <span style="color: #bb0000">abiword</span> ]<br />
<span style="font-weight: bold">abiword</span> (2.8.6-7) from staging<nowiki><br />
</nowiki>[ <span style="color: #bb0000">abiword</span> ]<br />
<span style="font-weight: bold">abiword</span> (2.8.6-7) from testing<nowiki><br />
</nowiki>[ <span style="color: #bb0000">abiword</span> ]<br />
<span style="color: #0a0">chiri</span> <span style="color: #00f">~/docs</span> <span style="color: #0f0">$</span> <span style="text-decoration: blink;">_</span></div><br />
<br />
for it to work, add the following to a zshrc: <br />
<br />
{{ic|[ -r /usr/share/doc/pkgfile/command-not-found.zsh ] && . /usr/share/doc/pkgfile/command-not-found.zsh}}<br />
<br />
=== Key Bindings ===<br />
Zsh does not use readline, instead it uses its own and more powerful zle. It does not read {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}.<br />
zle has an [[emacs]] mode and a [[vi]] mode. By default, it tries to guess whether you want emacs or vi keys from the {{ic|$EDITOR}} environment variable. If it is empty, it will default to emacs. You can change this with {{ic|bindkey -v}} or {{ic|bindkey -e}}.<br />
<br />
To get some special keys working:<br />
{{hc|~/.zshrc|2=<br />
# create a zkbd compatible hash;<br />
# to add other keys to this hash, see: man 5 terminfo<br />
typeset -A key<br />
<br />
key[Home]=${terminfo[khome]}<br />
<br />
key[End]=${terminfo[kend]}<br />
key[Insert]=${terminfo[kich1]}<br />
key[Delete]=${terminfo[kdch1]}<br />
key[Up]=${terminfo[kcuu1]}<br />
key[Down]=${terminfo[kcud1]}<br />
key[Left]=${terminfo[kcub1]}<br />
key[Right]=${terminfo[kcuf1]}<br />
key[PageUp]=${terminfo[kpp]}<br />
key[PageDown]=${terminfo[knp]}<br />
<br />
# setup key accordingly<br />
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line<br />
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line<br />
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode<br />
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char<br />
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history<br />
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history<br />
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char<br />
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char<br />
<br />
# Finally, make sure the terminal is in application mode, when zle is<br />
# active. Only then are the values from $terminfo valid.<br />
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then<br />
function zle-line-init () {<br />
printf '%s' ${terminfo[smkx]}<br />
}<br />
function zle-line-finish () {<br />
printf '%s' ${terminfo[rmkx]}<br />
}<br />
zle -N zle-line-init<br />
zle -N zle-line-finish<br />
fi<br />
}}<br />
<br />
{{Note|To get the proper sequences for certain key combinations, start {{Ic|cat}} or {{Ic|read}} without any parameters and press them; they should then be printed in the terminal. Both can be closed again via {{Keypress|Ctrl+C}}.}}<br />
<br />
===History search===<br />
You can add these lines to your .zshrc<br />
<br />
{{hc|~/.zshrc|<nowiki><br />
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward<br />
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward<br />
</nowiki>}}<br />
<br />
Doing this, only past commands beginning with the current input would have been shown.<br />
<br />
===Prompts===<br />
<br />
There is a quick and easy way to set up a colored prompt in Zsh. Make sure that prompt is set to autoload in your {{ic|.zshrc}}. This can be done by adding these lines to:<br />
<br />
{{hc|~/.zshrc|<br />
autoload -U promptinit<br />
promptinit<br />
}}<br />
<br />
You can now see available prompts by running the command:<br />
<br />
$ prompt -l<br />
<br />
To try one of the commands that is listed, use the command prompt followed by the name of the prompt you like. For example, to use the {{ic|walters}} prompt, you would enter:<br />
<br />
$ prompt walters<br />
<br />
===Customizing your prompt===<br />
<br />
In case you are dissatisfied with the prompts mentioned above(or want to expand their usefulness), zsh offers the possibility to build your own custom prompt. Zsh supports a left- and right-sided prompt additional to the single, left-sided prompt that is common to all shells. You can customize it by using {{ic|1=PROMPT=}} with the following variables:<br />
<br />
====Prompt variables====<br />
=====General=====<br />
; %n : The username<br />
; %m : The computer's hostname(truncated to the first period)<br />
; %M : The computer's hostname<br />
; %l : The current tty<br />
; %? : The return code of the last-run application.<br />
; %# : The prompt based on user privileges ({{Ic|#}} for root and {{Ic|%}} for the rest)<br />
<br />
=====Times=====<br />
; %T : System time(HH:MM)<br />
; %* : System time(HH:MM:SS)<br />
; %D : System date(YY-MM-DD)<br />
<br />
=====Directories=====<br />
; %~ : The current working directory. If you are in you are in your {{ic|$HOME}}, this will be replaced by {{ic|~}}.<br />
; %d : The current working directory.<br />
<br />
For the options mentioned above: You can prefix an integer to show only certain parts of your working path. If you entered {{Ic|%1d}} and found yourself in {{Ic|/usr/bin}} it would show {{Ic|bin}}. This can also be done with negative integers:<br />
{{Ic|%-1d}} using the same directory as above would show {{Ic|/}}.<br />
<br />
=====Formatting=====<br />
; %U [...] %u : Begin and end underlined print<br />
; %B [...] %b : Begin and end bold print<br />
; %{ [...] %} : Begin and enter area that will not be printed. Useful for setting colors.<br />
:In fact, this tag forces Zsh to ignore anything inside them when making indents for the prompt as well.<br />
:As such, not to use it can have some weird effects on the margins and indentation of the prompt.<br />
<br />
=====Colors=====<br />
Zsh has a different approach to setting colors on the terminal than the one depicted [https://wiki.archlinux.org/index.php/Color_Bash_Prompt here]. First you write before {{ic|1=PROMPT=}} in your {{Ic|.zshrc}}:<br />
autoload -U colors && colors<br />
<br />
Following commands would now produce the color escape sequence needed to set the requested color when the prompt is printed:<br />
; $fg[color] : will set the text color (red, green, blue, etc. - defaults to bold)<br />
; $fg_no_bold[color]: will set the non-bold text color<br />
; $fg_bold[color]: will set the bold text color <br />
; $reset_color : will reset the text color to white<br />
It is useful to put these color commands inside {{Ic|%{ [...] %} }}, so the shell knows there is no output from these sequences and the cursor hasn't moved.<br />
<br />
;Possible color values<br />
{| border="1"<br />
|-<br />
|black || red<br />
|-<br />
|green || yellow<br />
|-<br />
|blue || magenta<br />
|-<br />
|cyan || white<br />
|-<br />
|}<br />
Note that bold text doesn't necessarily use the same colors as normal text. For example, $fg['yellow'] looks brown or a very dark yellow, while $fg_no_bold['yellow'] looks like bright or regular yellow.<br />
<br />
====Example====<br />
To have a two-sided prompt you could write:<br />
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg_no_bold[yellow]%}%1~ %{$reset_color%}%#"<br />
RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"<br />
<br />
It would equal(without colors):<br />
username@host ~ % [0]<br />
<br />
===Sample .zshrc files===<br />
<br />
Here is a list of {{ic|.zshrc}} files. Feel free to add your own:<br />
<br />
* [https://github.com/sorin-ionescu/prezto Prezto - Instantly Awesome Zsh] is a configuration framework for Zsh. It comes with modules, enriching the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.<br />
* [https://github.com/robbyrussell/oh-my-zsh Oh-my-zsh Plugin and Theme system for Zsh] can help you manage your zshrc file and has a huge community of over 2000 forks on github;<br />
* Basic setup, with dynamic prompt and window title/hardinfo => http://github.com/MrElendig/dotfiles-alice/blob/master/.zshrc;<br />
* An Arch package named [https://www.archlinux.org/packages/extra/any/grml-zsh-config/ grml-zsh-config] comes from http://grml.org/zsh and provides a zshrc file that includes many tweaks for your zshell.<br />
* https://github.com/slashbeast/things/blob/master/configs/DOTzshrc - zshrc with multiple features, be sure to check out comments into it. Notable features: confirm function to ensure that user wnat to run poweroff, reboot or hibernate, support for GIT in prompt (done without vcsinfo), tab completion with menu, printing current executed command into window's title bar and more.<br />
<br />
==Global configuration==<br />
Occasionally you might want to have some settings applied globally to all zsh users. The zsh wiki tells us that there are some global configuration files, for example {{ic|/etc/zshrc}}. This however is slightly different on ArchLinux, since it has been compiled with flags specifically to target {{ic|/etc/zsh/}} instead.<br />
<br />
So, for global configuration use {{ic|/etc/zsh/zshrc}}, not {{ic|/etc/zshrc}}. The same goes for {{ic|/etc/zsh/zshenv}}, {{ic|/etc/zsh/zlogin}} and {{ic|/etc/zsh/zlogout}}. Note that these files are not installed by default, so you need to create them yourself if you want to use them.<br />
<br />
The only exception is zprofile, use {{ic|/etc/profile}} instead.<br />
<br />
===Autostarting applications===<br />
Zsh always executes {{ic|/etc/zsh/zshenv}} and {{ic|$ZDOTDIR/.zshenv}} so do not bloat these files.<br />
<br />
If the shell is a login shell, commands are read from {{ic|/etc/profile}} and then {{ic|$ZDOTDIR/.zprofile}}. Then, if the shell is interactive, commands are read from {{ic|/etc/zsh/zshrc}} and then {{ic|$ZDOTDIR/.zshrc}}. Finally, if the shell is a login shell, {{ic|/etc/zsh/zlogin}} and {{ic|$ZDOTDIR/.zlogin}} are read.<br />
<br />
==Uninstallation==<br />
If you decide that Zsh is not the shell for you and you want to return to Bash, you must first change the default shell, before removing the Zsh package.<br />
<br />
{{Warning| Failure to follow the below procedures will result in all kinds of problems.}}<br />
<br />
Paste the following command in terminal as root:<br />
# chsh -s /bin/bash user<br />
Use it for every user using Zsh.<br />
<br />
Now you can safely remove the Zsh package.<br />
<br />
If you did not follow the above, you can still change the default shell back to Bash by editing {{ic|/etc/passwd}} as root. <br />
<br />
{{Warning| It is '''strongly''' recommended to use vipw when editing user information as it prevents badly formatted entries.}}<br />
<br />
For example: <br />
<br />
from:<br />
username:x:1000:1000:Full Name,,,:/home/username:/bin/zsh<br />
to:<br />
username:x:1000:1000:Full Name,,,:/home/username:/bin/bash<br />
<br />
==See also==<br />
*[http://zsh.sourceforge.net/Intro/intro_1.html#SEC1 Zsh Introduction]<br />
*[http://zsh.sourceforge.net/Guide/zshguide.html Users Guide]<br />
*[http://zsh.sourceforge.net/Doc/Release/index-frame.html Zsh Docs] (you can choose a different format for the doc in http://zsh.sourceforge.net/Doc/)<br />
*[http://zsh.sourceforge.net/FAQ/zshfaq01.html Zsh FAQ]<br />
*[http://zshwiki.org/home/ Zsh Wiki]<br />
*[http://grml.org/zsh/zsh-lovers.html Zsh-lovers]<br />
*[http://www.bash2zsh.com/zsh_refcard/refcard.pdf Bash2Zsh Reference Card]<br />
*[https://github.com/robbyrussell/oh-my-zsh Oh My Zshell by Robby Russell] <br />
*[http://www.gentoo.org/doc/en/zsh.xml Gentoo Linux Documentation -- zsh Configuration and Installation Guide]<br />
*[http://my.opera.com/blackbelt_jones/blog/2007/06/05/zsh-prompt-configuration-issue-solved Setting up the zsh prompt]<br />
<br />
*'''IRC channel''': #zsh at irc.freenode.org</div>Chionsashttps://wiki.archlinux.org/index.php?title=Exaile&diff=247369Exaile2013-02-15T00:04:10Z<p>Chionsas: Added fix for the integrated Last.fm "loved tracks" plugin not working due to lack of python2-pylast on the system.</p>
<hr />
<div>[[Category:Player]]<br />
[[es:Exaile]]<br />
[[it:Exaile]]<br />
[[ru:Exaile]]<br />
[http://www.exaile.org/ Exaile] is a music manager and player for GTK+ written in Python. It incorporates automatic fetching of album art, lyrics fetching, Last.fm scrobbling, support for many portable media players, internet radio such as shoutcast, and tabbed playlists.<br />
<br />
==Installation==<br />
<br />
{{AUR|Exaile}} is available in the [[AUR]].<br />
<br />
If you use [[ALSA]] and want to use alsasink instead of the default one, [[pacman|install]] {{Pkg|gstreamer0.10-base-plugins}} available in the [[Official Repositories]]. This may solve problem if no sound is heard after installation and also when trying to play several sources simultaneously.<br />
<br />
===Enabling cover art, lyrics, and guitar tablature===<br />
While installing Exaile via Pacman will also install any needed runtime dependencies, two additional packages {{pkg|gnome-python-extras}} & {{Pkg|libgtkhtml}} will be needed to enable the cover art, lyrics, guitar tablature, and wiki features of Exaile.<br />
<br />
pacman -S gnome-python-extras libgtkhtml<br />
<br />
===Playing audio CDs===<br />
Exaile requires 'python-cddb' to play audio cd's. The correct package for this is [https://aur.archlinux.org/packages.php?do_Details=1&ID=3717&O=0&L=0&C=0&K=cddb&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=ndcddb-py/ cddb-py].<br />
<br />
==Enabling multimedia keys irrespective of DE/WM==<br />
<br />
First, run {{ic|xev}} and retrieve the keycodes for the Previous, Next, Play, Stop, and Mute keys. Then create a textfile and add lines in the following format: {{ic|keycode 173 &#61; XF86AudioPrev}}. Replace the keycode (173) with your own keycode for the Previous key. Repeat the process for the other keys, substituting 'Prev' for 'Next', 'Play', 'Stop', and 'Mute'.<br />
<br />
Then edit {{ic|~/.xinitrc}} and add the line {{ic|xmodmap <file name>}} prior to the 'exec' command (if there is one) for the DE/WM, where <file name> is the path to the text file created above.<br />
<br />
Finally, in Exaile, go to Edit → Preferences → Plugins, and enable the XKeys plugin. After a restart, multimedia keys should work.<br />
<br />
==Troubleshooting==<br />
<br />
===Progress bar stuck at 0:00===<br />
First, make sure there are no problems with your sound architecture ([[ALSA]], [[OSS]], etc.). And your ''playback sink'' in Exaile is set correctly. Try setting it to automatic first.<br />
<br />
If you're trying to listen to an MP3 file, try playing an audio file encoded in a different format, such as .ogg or .flac. If these play correctly then try installing gstreamer-ugly.<br />
<br />
pacman -S gstreamer0.10-ugly gstreamer0.10-ugly-plugins<br />
<br />
==="Playback error encountered! Configured audiosink bin0 is not working"===<br />
If you're getting a message like this, or "Configured audiosink bin1 is not working" (or with another number after 'bin'), it may be because Flash is blocking the use of ALSA by Exaile. You can fix this by running<br />
<br />
killall npviewer.bin<br />
<br />
In certain cases (such as if a YouTube video has finished playing), Flash may be blocking the use of ALSA even if an 'npviewer.bin' process is not running. In that case, refreshing the offending page while using a Flash blocking browser extension should fix the problem.<br />
<br />
===Playing from SMB share===<br />
Unfortunately, Exaile does NOT support smb protocol.<br />
<br />
==="Last.fm Loved Tracks" plugin not working===<br />
When launched from console, Exaile emits a warning in the command line:<br />
<br />
WARNING : Error while connecting to Last.fm network: 'module' object has no attribute 'LastFMNetwork'<br />
<br />
You need to install the [https://aur.archlinux.org/packages/python2-pylast/ python2-pylast package] from AUR.</div>Chionsashttps://wiki.archlinux.org/index.php?title=Fprint&diff=247355Fprint2013-02-14T22:18:50Z<p>Chionsas: pam_fprint_enroll became fprintd-enroll and fingerprints are stored in /var/lib/fprint/</p>
<hr />
<div>[[Category:Input devices]]<br />
[[bg:Fprint]]<br />
[[fa:Fprint]]<br />
{{out of date|Fprint is now in Extra repository, names of some commands are changed.}}<br />
From [http://reactivated.net/fprint/wiki/Pam_fprint Pam fprint - fprint project]:<br />
<br />
:''pam_fprint is a simple PAM module which uses libfprint's fingerprint processing and verification functionality for authentication. In other words, instead of seeing a password prompt, you're asked to scan your fingerprint.''<br />
<br />
The idea is to use the built-in fingerprint reader in some notebooks for login using PAM. This article will also explain how to use regular password for backup login method (solely fingerprint scanner is not recommended due to numerous reasons).<br />
<br />
== Prerequisites ==<br />
<br />
First, make sure you have one of the supported finger scanners. You can check if your device is supported by checking [http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader this] list of supported devices. To check which one you have, type<br />
# lsusb<br />
<br />
You need to install '''pam''' and the '''fprint''' group.<br />
# pacman -S pam fprint<br />
<br />
== Installation ==<br />
<br />
Some dependencies:<br />
# pacman -S libusb imagemagick<br />
<br />
Once you made sure your reader is supported, you are good to go.<br />
<br />
== Configuration ==<br />
<br />
=== Permissions ===<br />
<br />
By default, only root has access to the device. You can create a signature from sudo, but then you can only use it for root user. The following solution from the Ubuntu forums may work for some people.<br />
<br />
1. If the group plugdev doesn't exist, create it<br />
# groupadd plugdev<br />
<br />
2. Add yourself to the group<br />
# gpasswd -a USER plugdev<br />
<br />
3. Allow USB access<br />
# chgrp -R plugdev /dev/bus/usb/<br />
<br />
=== Login configuration ===<br />
<br />
Modify the auth section of /etc/pam.d/login to this<br />
auth required pam_env.so<br />
auth sufficient pam_fprintd.so<br />
auth sufficient pam_unix.so try_first_pass likeauth nullok<br />
auth required pam_deny.so<br />
<br />
This tries to use fingerprint login first, and if if fails or if it finds no fingerprint signatures in the give user's home directory, it proceeds to password login.<br />
<br />
You can also modify other files in /etc/pam.d/ using the same method, for example /etc/pam.d/gdm for GNOME's fingerprint login or /etc/pam.d/polkit-1 for GNOME PolicyKit Authentication.<br />
<br />
=== Create fingeprint signature ===<br />
<br />
Now you should be able to run the program under a normal user. To see the usage, run<br />
$ man fprintd<br />
Chose one of the fingers and run <br />
$ fprintd-enroll<br />
You will be asked to scan the given finger 3 times. After that, the signature is created in /var/lib/fprint/.<br />
<br />
== Setup fingerprint-gui ==<br />
<br />
An alternate fingerprint reader gui.<br />
This works with libfprint-unstable which has support for the new Upeksonly readers, such as,<br />
the new Thinkpad W510 T510 T410 T420 Upeksonly reader with USB ID 147e:2016<br />
<br />
http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader<br />
<br />
http://www.n-view.net/Appliance/fingerprint/<br />
<br />
Install a dependency:<br />
$ pacman -S libfakekey<br />
<br />
Install fingerprint-gui from AUR<br />
$ yaourt -S fingerprint-gui<br />
<br />
Please make sure your user is a member of "plugdev" and "scanner" group if you use UPEK non-free library. You may also have to log out and back in for these changes to take effect.<br />
# gpasswd -a USER plugdev<br />
# gpasswd -a USER scanner<br />
<br />
fingerprint-polkit-agent conflicts with files in /etc/xdg/autostart that must<br />
be removed:<br />
"polkit-gnome-authentication-agent-1.desktop" and<br />
"polkit-kde-authentication-agent-1.desktop".<br />
<br />
Edit your PAM configuration<br />
(e.g., /etc/pam.d/{login,su,sudo,gdm}).<br />
<br />
Change the auth section to read<br />
<br />
auth required pam_env.so<br />
auth sufficient pam_fingerprint-gui.so<br />
auth sufficient pam_unix.so try_first_pass likeauth nullok<br />
auth required pam_deny.so<br />
<br />
Add this to your ~/.bashrc file if you get an error saying that it can't connect to X desktop.<br />
xhost + &><br />
<br />
Now run fingerprint-gui and register fingerprints for the current user. You will need to run fingerprint-gui and register fingerprints as all users you want to use the fingerprint reader, i.e. as root to use it for "su" login.</div>Chionsas