Difference between revisions of "Anything-sync-daemon"

From ArchWiki
Jump to navigation Jump to search
m (Link)
m (Edit /etc/asd.conf: Template)
Line 20: Line 20:
=== Edit /etc/asd.conf ===
=== Edit /etc/asd.conf ===
Edit the included {{ic|/etc/asd.conf}} defining the target directories in the '''WHATTOSYNC''' array.  These will be syncronized and managed by asd.  At least one location needs to be defined.
Edit the included {{ic|/etc/asd.conf}} defining the target directories in the '''WHATTOSYNC''' array.  These will be syncronized and managed by asd.   
{{note|At least one location needs to be defined.}}

Revision as of 23:39, 6 April 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary end

Benefits of Asd

Running this daemon is beneficial for two reasons:

  1. Reduced wear to physical discs
  2. Speed

Since the target directories are relocated into tmpfs, the corresponding onslaught of I/O associated with system usage of them is also redirected from the physical disc to RAM, thus reducing wear to the physical disc and also improving speed and responsiveness. The access time of RAM is on the order of nanoseconds while the access time of physical discs is on the order of milliseconds. This is a difference of six orders of magnitude or 1,000,000 times faster.

Setup and Installation

Anything-sync-daemonAUR is available for download from the AUR. Build it and install like any other package.

Edit /etc/asd.conf

Edit the included /etc/asd.conf defining the target directories in the WHATTOSYNC array. These will be syncronized and managed by asd.

Note: At least one location needs to be defined.


WHATTOSYNC=('/var/log' '/srv/http' '/home/foo/bar')

Optionally redefine the location of the tmpfs space to use. Do this in the TMPFS variable. Note that for Arch Linux, the default value of /dev/shm should work just fine. Be sure to read the warning about using software such as bleachbit with asd since bleachbit likes to remove files stored in /tmp. This is why a value of /dev/shm is better.

Using asd

The initial synchronization will occur when the daemon starts. Additionally, cron (if running) will call it to sync or update once per hour. Finally, asd will sync back a final time when it is called to stop.

Using SysVinit (Arch default)

Call the daemon to start, stop, or sync (restart) like any standard Arch daemon:

# rc.d command asd

It is highly recommended to start/stop the daemon at boot/shutdown. This is accomplished by adding asd to the DAEMONS array in /etc/rc.conf like so:

DAEMONS=(... @asd ...)

Using systemd

Users making use of Systemd may manage the service using the systemctl command. Start/stop the service using:

# systemctl start asd.service
# systemctl stop asd.service

Enable the asd daemon to start/stop at boot/shutdown (highly recommended) using:

# systemctl enable asd.service

Sync at More Frequent Intervals (Optional)

Note: This step is NOT required. asd will update once per hour on its own.

Users wishing to have syncs occur more frequently can simply add a line to the root crontab to call the sync function of asd like so:

# crontab -e

Example syncing targets once every ten minutes:

 */10 * * * *     rc.d sync asd &> /dev/null


Post in the discussion thread with comments or concerns.