https://wiki.archlinux.org/api.php?action=feedcontributions&user=Delian&feedformat=atomArchWiki - User contributions [en]2024-03-28T11:29:19ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Profile-sync-daemon&diff=252951Profile-sync-daemon2013-04-05T09:27:37Z<p>Delian: Corrected link to chakra package ( was 5007 but is 5008 )</p>
<hr />
<div>[[Category:Web Browser]]<br />
[[Category:Scripts]]<br />
{{Article summary start}}<br />
{{Article summary text|{{AUR|Profile-sync-daemon}} (psd) is a diminutive pseudo-daemon designed to manage your browser's profile in tmpfs and to periodically sync it back to your 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 psd is a completely transparent user experience.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Anything-sync-daemon}}<br />
{{Article summary wiki|Firefox}}<br />
{{Article summary wiki|Chromium}}<br />
{{Article summary wiki|Opera}}<br />
{{Article summary wiki|SSD}}<br />
{{Article summary end}}<br />
<br />
== Benefits of Psd ==<br />
Running this daemon is beneficial for two reasons:<br />
#Reduced wear to physical discs<br />
#Speed<br />
<br />
Since the profile(s), browser cache*, etc. are relocated into tmpfs (RAM disk), the corresponding onslaught of I/O associated with using the browser is also redirected from the physical disc to RAM, thus reducing wear to the physical disc and also greatly improving browser speed and responsiveness. For example, 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.<br />
<br />
{{Note|Chromium actually keeps its cache directory '''separately''' from its browser profile directory. It is not within the scope of profile-sync-daemon to modify this behavior; users are encouraged to refer to the [[Chromium_Tips_and_Tweaks#Cache_in_tmpfs]] section of the main [[Chromium_Tips_and_Tweaks]] article for several work-arounds.}}<br />
<br />
==Supported Browsers ==<br />
Currently, the following browsers are auto-detected and managed:<br />
*[[chromium]]<br />
*{{AUR|conkeror}}<br />
*[[firefox]] (all flavors including stable, beta, and aurora)<br />
*[http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html firefox-trunk]<br />
*{{AUR|google-chrome}}<br />
*[https://bbs.archlinux.org/viewtopic.php?id=117157 heftig's version of aurora]<br />
*[[midori]]<br />
*[[opera]]<br />
*{{AUR|opera-next}}<br />
*[[qupzilla]]<br />
<br />
{{Note|Heftig's version of Aurora is an Arch Linux only browser.}}<br />
{{Note|Firefox-trunk is an Ubuntu-only only browser.}}<br />
<br />
==Setup and Installation==<br />
{{AUR|Profile-sync-daemon}} is available for download from the [[Arch User Repository|AUR]]. Build it and install like any other package. <br />
<br />
=== Edit /etc/psd.conf ===<br />
Edit the included {{ic|/etc/psd.conf}} defining which user(s) will have their profiles managed by psd.<br />
<br />
Example:<br />
# List users separated by spaces whose browser(s) profile(s) will get symlinked <br />
# and sync'ed to tmpfs.<br />
# Do NOT list a user twice!<br />
USERS="facade happy"<br />
<br />
{{Note|At least one user must be defined.}}<br />
<br />
Optionally uncomment the BROWSERS array and populate it with whichever browser(s) are to be sync'ed to tmpfs. If the BROWSERS array stays commented (default) then all supported browser profiles will be sync'ed if they exist.<br />
<br />
Example: Let's say that Chromium, Opera and Midori are installed but only Chromium and Opera are to be sync'ed to tmpfs since the user keeps Midori as a backup browser and it is seldom used:<br />
<br />
# List browsers separated by spaces to include in the sync. Useful if you do not<br />
# wish to have all possible browser profiles sync'ed.<br />
#<br />
# Possible values:<br />
# chromium<br />
# conkeror.mozdev.org<br />
# firefox<br />
# firefox-trunk<br />
# google-chrome<br />
# heftig-aurora <br />
# midori<br />
# opera<br />
# opera-next<br />
# qupzilla<br />
#<br />
# If the following is commented out (default), then all available/supported <br />
# browsers will be sync'ed, separated by comma<br />
BROWSERS="chromium,opera"<br />
<br />
== Using PSD ==<br />
=== Preview Mode (Parse) ===<br />
The 'parse' option can be called to show users exactly what psd will do based on the /etc/psd.conf entered. Call it like so:<br />
$ profile-sync-daemon parse<br />
Profile-sync-daemon v5.24<br />
<br />
Psd will manage the following per /etc/psd.conf settings:<br />
<br />
browser/psname: chromium/chromium<br />
owner/group: facade/users<br />
sync target: /home/facade/.config/chromium<br />
tmpfs dir: /tmp/facade-chromium<br />
profile size: 81M<br />
<br />
browser/psname: firefox/firefox<br />
owner/group: facade/users<br />
sync target: /mnt/data/docs/facade/mozilla/firefox/1Zp9V43q.banking<br />
tmpfs dir: /tmp/facade-firefox-1Zp9V43q.banking<br />
profile size: 5.9M<br />
<br />
browser/psname: firefox/firefox<br />
owner/group: facade/users<br />
sync target: /mnt/data/docs/facade/mozilla/firefox/obg67zqQ.proxy<br />
tmpfs dir: /tmp/facade-firefox-obg67zqQ.proxy<br />
profile size: 17M<br />
<br />
As shown in the output and as stated above, if no specific browser or subset of browsers are defined in the BROWSERS array, psd will sync ALL supported profiles that it finds for the given user(s).<br />
<br />
=== Running PSD to Manage Profiles ===<br />
Do not call {{ic|/usr/bin/profile-sync-daemon}} to sync or to unsync directly. Instead use the provided service files. <br />
<br />
Both a systemd service file and a timer are provided and should be used to interact with psd. Both should be invoked together! The role of the timer is update the tmpfs copy/copies back to the disk which it does once per hour. Failure to start the resync timer will result in the profile being sync'ed only on start up and shutdown.<br />
<br />
# systemctl [option] psd psd-resync<br />
<br />
Available options:<br />
start Turn on daemon and timer.<br />
stop Turn off daemon and timer.<br />
enable Autostart daemon and timer on boot-up.<br />
disable Don't autostart daemon and timer on boot-up.<br />
<br />
<br />
Start psd and its timer as well as set psd and its timer to start/stop at boot/shutdown ''(highly recommended)'':<br />
# systemctl enable psd psd-resync<br />
# systemctl start psd psd-resync<br />
<br />
Obviously, you must first close your browser before starting the service.<br />
<br />
=== Sync at More Frequent Intervals (Optional) ===<br />
The package provided timer syncs once per hour. Users may optionally redefine this behavior simply be creating their own timer with whatever interval is desired. The example below syncs once every ten minutes:<br />
<br />
{{hc|/etc/systemd/system/my-psd-resync.timer|2=<nowiki><br />
[Unit]<br />
Description=My own profile resync<br />
After=psd.service<br />
Conflicts=psd-resync.timer<br />
<br />
[Timer]<br />
Unit=psd-resync.service<br />
OnUnitActiveSec=10min<br />
</nowiki>}}<br />
{{Note|The 'Conflicts...' line disables the package-provided timer and allows 'my-psd-resync.timer' to take over and work with psd-resync.service.}}<br />
<br />
See `man systemd.timer` for additional options.<br />
<br />
== Caveats for Firefox and Heftig's Aurora ONLY ==<br />
The way psd keeps track of browser profiles and sync targets requires users to have a unique name as the ''last directory'' for all profiles in their respective $HOME/.mozilla/<browser>/profiles.ini files. Psd will check when it is called to run for this and refuse if this rule is not satisfied. The following is an example of a BAD profile that will fail the the test. Note that although each full path is unique, they both ''end'' in the same name! Again, the user must modify the profiles.ini and the corresponding directory on the filesystem to correct this in order to use Psd.<br />
<br />
$ cat ~/.mozilla/firefox/profiles.ini<br />
<br />
[General]<br />
StartWithLastProfile=1<br />
<br />
[Profile0 for user facade]<br />
Name=normal<br />
IsRelative=0<br />
Path=/mnt/data/docs/'''facade'''/mozilla/firefox/'''myprofile.abc'''<br />
Default=1<br />
<br />
[Profile1 for user happy]<br />
Name=proxy<br />
IsRelative=0<br />
Path=/mnt/data/docs/'''happy'''/mozilla/firefox/'''myprofile.abc'''<br />
<br />
== Support ==<br />
Post in the [https://bbs.archlinux.org/viewtopic.php?pid=1026974 discussion thread] with comments or concerns.<br />
<br />
== PSD On Other Distros ==<br />
Psd is a simple bash script and should therefore run on any Linux distro. Below is a list of distros known to package psd, and a link to download their respective packages. As noted above, these are unsupported by the author due to their own, unique init scripts:<br />
<br />
=== Chakra ===<br />
http://chakra-linux.org/ccr/packages.php?ID=5008<br />
<br />
=== Debian ===<br />
To add the PPA (personal package archive) to your Debian (tested on squeeze) system, and to install psd:<br />
<br />
# echo "deb http://ppa.launchpad.net/graysky/utils/ubuntu quantal main" > /etc/apt/sources.list.d/graysky.list<br />
# echo "deb-src http://ppa.launchpad.net/graysky/utils/ubuntu quantal main" >> /etc/apt/sources.list.d/graysky.list<br />
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FF7F9516<br />
# apt-get update<br />
# apt-get install profile-sync-daemon<br />
<br />
=== Exherbo ===<br />
http://git.exherbo.org/summer/packages/net-www/profile-sync-daemon<br />
<br />
=== Fedora 18 ===<br />
http://repo-ck.com/fedora_rpms<br />
<br />
=== Gentoo ===<br />
http://packages.gentoo.org/package/www-misc/profile-sync-daemon<br />
=== Ubuntu ===<br />
To add the PPA (personal package archive) to your Ubuntu (packages available for Lucid and newer) system, and to install psd:<br />
<br />
$ sudo add-apt-repository ppa:graysky/utils<br />
$ sudo apt-get update<br />
$ sudo apt-get install profile-sync-daemon<br />
<br />
== External Links Mentioning PSD ==<br />
*http://www.webupd8.org/2013/02/keep-your-browser-profiles-in-tmpfs-ram.html<br />
*http://bernaerts.dyndns.org/linux/250-ubuntu-tweaks-ssd</div>Delian