Change storage path location for the Resilio Agent
Storage path is the directory where the Agent keeps its setting, database files, debug logs and other service information. For information on default storage folder location, see Storage folder.
It's possible to keep the storage on a different location. Follow the steps below for each of the operating systems. Mind the peculiarities and limitations for each. It is vital that the user under who Agent runs has recursive read-write access to the new storage location
There are two ways to do it on Windows. Only local drives can be used for new storage location. Network shares are not available for Agents service session - you will need to map them in the service session using this guide.
Using registry editor
- Stop Resilio Agent service. Copy its current storage folder to the new location.
- Open registry editor (Ctrl+R -> regedit) and navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\connectsvc
- Edit key
ImagePath
and add"/STORAGE" "D:\Path\to\storage"
(with quotes) at the end of the line - Start the service.
Using Agent configuration file. This is a good way in case of mass deployment of agents.
- Stop the Agent if it's already installed and running.
- Add line
"storage_path": "D:\\Storage\\ConnectAgent",
(mind double slash and missing trailing slash) into the configuration file. Be sure to stick to JSON format. - Start the Agent.
To ensure that the Agent indeed uses the new storage location, you may remove or rename sync.log file in it before starting the Agent. New sync.log file shall be created after start. Another way to verify it is after starting the Agent to look inside sync.pid file, which is a regular text file, and see that current Agent's PID is written there.
After you have confirmed that the new storage is used by the Agent and that the settings are all preserved, it's safe to clear space on the previous storage location.
Depending on how you have Resilio Agent installed, use either of the methods.
Downloaded and launched rslagent binary file
- Stop the
rslagent
process. - Copy the content of current storage to the new location.
- Point the Agent to the new storage location. One of the options is to add
--storage /path/to/new/storage
parameter to the launch line. The launch line must have also--server
parameter to connect to the Management Console. Another option is to add"storage_path": "/path/to/new/storage",
into the configuration file. Configuration file must have Management Server configured as well. Be sure to stick to JSON format - Start the agent.
Agent installed through a package manager
1. Stop the service.
2. Navigate (or create if doesn't exist) to /etc/systemd/system/resilio-agent.service.d
and create file override.conf
there.
3. Edit the override.conf
file and add the following:
[Service]
Environment="AGENT_LIB_DIR=/var/lib/resilio-agent2"
PIDFile=/var/lib/resilio-agent2/sync.pid
where /var/lib/resilio-agent2
- is a path to some custom storage folder.
- Run command
sudo systemctl daemon-reload
. - Start the service and check its status to verify that new storage is indeed used. New folder shall be created and store Agent's service files. After you have confirmed that the new storage is used by the Agent and that the settings are all preserved, it's safe to clear space on the previous storage location.
On macOS this can be achieved by editing Agent's configuration file.
- Stop Resilio Agent.
- Copy the content of current storage folder to the new location.
-
Edit configuration file and add line
"storage_path": "/path/to/new/storage",
into the configuration file. Be sure to stick to JSON format. Put the editedsync.conf
file to the new storage. On macOS, use a plain text editor to avoid extra formatting in the file.Info
The tricky part on macOS is that sync.conf file is located in Agent's storage. If you already run the Agent with config file, do not delete the previous storage folder until you start and stop the Agent at least once for it to save the new storage path in its settings.
-
Start Resilio Agent.
Info
If you didn't run the Agent with configuration file, first launch shall be made from the Terminal.app with command
/Applications/Resilio\ Connect\ Agent.app/Content/MacOS/Resilio\ Connect\ Agent --config /path/to/sync.conf
On Android device is only possible using configuration file.
- Generate
sync.conf
file on Management Console and rename it tosync_default.conf
. - Add
storage_path
paramter tosync_default.conf
. Example:“storage_path”: “/storage/emulated/0/path_to_folder”
wherepath_to_folder
points to an already existing folder. We recommend using custom folder like.sync
. - Deliver
sync_default.conf
to agent as mentioned in Connecting Android Agent to Management Console. - Start Resilio Agent.