Update doc according to new bind mounting technique

This commit is contained in:
Naughtylus
2016-09-11 17:16:20 +02:00
parent ccd2442768
commit f9d694f39a
3 changed files with 21 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
#Anything-sync-daemon
Anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user defined dirs in tmpfs and to periodically sync back to the physical disc (HDD/SSD). This is accomplished via a symlinking step and an innovative use of rsync to maintain back-up and synchronization between the two. One of the major design goals of asd is a completely transparent user experience.
Anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user defined dirs in tmpfs and to periodically sync back to the physical disc (HDD/SSD). This is accomplished via several bind mounting steps and an innovative use of rsync to maintain back-up and synchronization between the two. One of the major design goals of asd is a completely transparent user experience.
##Documentation
Consult the man page or the wiki page: https://wiki.archlinux.org/index.php/Anything-sync-daemon

View File

@@ -178,10 +178,16 @@ root_check() {
}
ungraceful_state_check() {
# if the machine was ungracefully shutdown then the backup will be
# on the filesystem and the link to tmpfs will be on the filesystem
# but the contents will be empty we need to simply remove the link
# and rotate the backup into place
# if the machine was ungracefully shutdown
# then the backup folders will remain,
# but the mounts and tmpfs won't.
# This leaves the target directories in the state of the last sync
# so they're usable as is, but data may have been lost.
# We may not be able to recover that data,
# but at least we can take a snapshot of the current state for the record.
# Besides, if using overlayfs technology,
# we do need to restore from the upper directory backup.
local DIR USER BACKUP TMP
for DIR in "${WHATTOSYNC[@]}"; do
# did user define a real dir
@@ -468,7 +474,7 @@ case "$1" in
[[ -f "$DAEMON_FILE" ]] && root_check && do_sync
;;
unsync)
# make sure the daemon ran to setup the links
# make sure the daemon ran to setup the bind mounts
[[ -f "$DAEMON_FILE" ]] && root_check && do_sync && do_unsync
;;
*)
@@ -486,16 +492,16 @@ case "$1" in
echo -e " ${BLD}Instead, use systemd to start/stop anything-sync-daemon."${NRM}
echo
echo -e " ${BLD}systemctl ${NRM}${GRN}[option]${NRM}${BLD} asd asd-resync"${NRM}
echo -e " ${BLD} ${NRM}${GRN}start${NRM}${BLD} Turn on daemon; make symlinks and actively manage targets in tmpfs."${NRM}
echo -e " ${BLD} ${NRM}${GRN}stop${NRM}${BLD} Turn off daemon; remove symlinks and rotate tmpfs data back to disc."${NRM}
echo -e " ${BLD} ${NRM}${GRN}start${NRM}${BLD} Turn on daemon; make bind mounts and actively manage targets in tmpfs."${NRM}
echo -e " ${BLD} ${NRM}${GRN}stop${NRM}${BLD} Turn off daemon; undo bind mounts and rotate tmpfs data back to disc."${NRM}
echo -e " ${BLD} ${NRM}${GRN}enable${NRM}${BLD} Autostart daemon when system comes up."${NRM}
echo -e " ${BLD} ${NRM}${GRN}disable${NRM}${BLD} Remove daemon from the list of autostart daemons."${NRM}
elif [[ -f /etc/init.d/asd ]]; then
echo -e " ${BLD}Instead, use the init system to start/stop anything-sync-daemon."${NRM}
echo
echo -e " ${BLD}sudo service asd ${NRM}${GRN}[option]${NRM}${BLD} or /etc/init.d/asd ${NRM}${GRN}[option]"${NRM}
echo -e " ${BLD} ${NRM}${GRN}start${NRM}${BLD} Turn on daemon; make symlinks and actively manage targets in tmpfs."${NRM}
echo -e " ${BLD} ${NRM}${GRN}stop${NRM}${BLD} Turn off daemon; remove symlinks and rotate tmpfs data back to disc."${NRM}
echo -e " ${BLD} ${NRM}${GRN}start${NRM}${BLD} Turn on daemon; make bind mounts and actively manage targets in tmpfs."${NRM}
echo -e " ${BLD} ${NRM}${GRN}stop${NRM}${BLD} Turn off daemon; undo bind mounts and rotate tmpfs data back to disc."${NRM}
fi
;;
esac

View File

@@ -1,10 +1,10 @@
.\" Text automatically generated by txt2man
.TH anything-sync-daemon 1 "04 September 2016" "" ""
.SH NAME
\fBanything-sync-daemon \fP- Symlinks and syncs user specified dirs to RAM thus reducing HDD/SDD calls and speeding-up the system.
\fBanything-sync-daemon \fP- bind mounts and syncs user specified dirs to RAM thus reducing HDD/SDD calls and speeding-up the system.
\fB
.SH DESCRIPTION
Anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user specified directories referred to as sync targets from here on out, in tmpfs and to periodically sync them back to the physical disc (HDD/SSD). This is accomplished via a symlinking step and an innovative use of rsync to maintain synchronization between a tmpfs copy and media-bound backups. Additionally, asd features several crash recovery features.
Anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user specified directories referred to as sync targets from here on out, in tmpfs and to periodically sync them back to the physical disc (HDD/SSD). This is accomplished via several bind mounting steps and an innovative use of rsync to maintain synchronization between a tmpfs copy and media-bound backups. Additionally, asd features several crash recovery features.
.PP
Design goals of asd:
.RS
@@ -148,9 +148,9 @@ Q2: Why do I see another directory ".foo-back-ovfs" when I enable overlayfs?
.PP
A2: The way overlayfs works is to mount a read-only base copy (so-called lower dir) of the target, and manage the new data on top of that. In order to avoid resyncing to the read-only file system, a copy is used instead. So using overlayfs is a trade off: faster initial sync times and less memory usage vs. disk space.
.PP
Q3: My system crashed and asd didn't sync back. What do I do?
Q3: What happens to my data when my system crashes?
.PP
A3: The "last good" backup of your sync targets is just fine still sitting happily on your filesystem. Upon restarting asd (on a reboot for example), a check is preformed to see if the symlink to the tmpfs copy of your sync target is valid. If it is invalid, asd will snapshot the "last good" backup before it rotates it back into place. This is more for a sanity check that asd did no harm and that any data loss was a function of something else.
A3: While the different bind mounts that asd performs allow for your targets to sit entirely and seemlessly on your RAM, they also make sure that the original directory that's still on your HDD gets synced regularly. So in case of power failure or system crash, you will find your data in the state that it has been last synced to. Upon restarting asd (on a reboot for example), a check is performed to see if asd has been interrupted abruptly. If it's the case, a snapshot of the "last good" state of your directories is taken, before syncing everything back into place. This is more for a sanity check that asd did no harm and that any data loss was a function of something else.
.PP
Q4: Where can I find this snapshot?
.PP
@@ -163,7 +163,7 @@ A5: Follow these steps:
.IP 1. 4
Stop asd.
.IP 2. 4
Confirm that there is no symlink to the sync target. If there is, asd did not stop correctly for other reasons.
Confirm that there are no un-date-time-stamped hidden backup directory (e.g. ".foo-backup_asd" or ".foo-back-ovfs"). If there are, asd did not stop correctly for other reasons.
.IP 3. 4
Move the "bad" copy of the sync taget to a backup (don't blindly delete anything).
.IP 4. 4