Asd or Psd?
Benefits of Asd
Running this daemon is beneficial for two reasons:
- Reduced wear to physical discs
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
AUR. Build it and install like any other package.AUR is available for download from the
User managed settings are defined in
/etc/asd.conf which is included in the package. At a minimum, define the target directory/directories to be managed by asd.
WHATTOSYNC=('/var/lib/monitorix' '/srv/http' '/foo/bar')
Optionally redefine the location of your distro's tmpfs. Do this by uncommenting and redefining the VOLATILE 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.
Optionally redefine the permissions of the link in tmpfs. The default is 700 to protect privacy of users.
Do not call /usr/bin/anything-sync-daemon directly (except to view debug mode). The initial synchronization will occur when the daemon starts. Additionally, cron (if running on your system) will call it to sync or update once per hour. Finally, asd will sync back a final time when it is called to stop.
The provided daemon file should be used to interact with asd (
# systemctl [option] asd.service
start Turn on daemon; make symlinks and actively manage targets in tmpfs. stop Turn off daemon; remove symlinks and rotate tmpfs data back to disc. enable Autostart daemon when system comes up. disable Remove daemon from the list of autostart daemons.
The required rc.d file (
/etc/rc.d/asd) is provided and should be used to manage asd.
# /etc/rc.d/asd [option]
start Turn on daemon; make symlinks and actively manage targets in tmpfs. stop Turn off daemon; remove symlinks and rotate tmpfs data back to disc.
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 ...)
The debug option can be called to show users exactly what asd will do based on the /etc/asd.conf entered. Call it like so:
$ anything-sync-daemon debug
Sync at More Frequent Intervals (Optional)
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 * * * * /usr/bin/anything-sync-daemon sync &> /dev/null
Post in the discussion thread with comments or concerns.