By default the conf, logs and perspectium_data directories will be saved in the directory where the DataSync Agent is installed. However, you can specify a different “working directory” for these files/directories.
The directories that can be moved to a different working directory contain the following files:
- conf - The configuration directory holds the agent.xml and log4j2.xml configuration files
- logs - The directory that holds the Agent's log files
- perspectium_data - The directory that holds temporary data while the Agent runs. By default, the perspectium_data directory is created in the bin directory. The perspectium_data directory is generated automatically when the Agent starts.
NOTE: You will still need to keep a conf directory in the directory where the Agent is installed. However, in the new working directory that you specify you must also create a conf directory containing your agent.xml and log4j2.xml files. The perspectium_data directory will be generated in the first level of the working directory alongside these two directories when the Agent starts.
Prerequisites
First, you will need to set up one of the Perspectium DataSync Agents.
You should also stop running your DataSync Agent before making any Agent configuration changes.
Procedure (Windows)
To specify working directories for the Agent in Windows, follow these steps:
Access the agent.bat file
Locate the agent.bat file in the directory where the Agent was installed.
Update the working directory
Open the agent.bat file in your preferred text editing application and locate the following line in the file:
SET JAVA_ARGS=-Xmx%2 -Dfile.encoding=UTF-8 -Dlog4j.configurationFile=“%~dp0..\conf\log4j2.xml” -Dcom.perspectium.working.directory=“DIRECTORY_PATH” -classpath “%~dp0..\jars*”;“%~dp0..\extlib*” com.perspectium.replicator.Replicator
Replace this line with:
SET JAVA_ARGS=-Xmx%2 -Dfile.encoding=UTF-8 -Dlog4j.configurationFile=“DIRECTORY_PATH\conf\log4j2.xml” -Dcom.perspectium.working.directory=“DIRECTORY_PATH” -classpath “%~dp0..\jars*”;“%~dp0..\extlib*” com.perspectium.replicator.Replicator
where DIRECTORY_PATH is the full path for the working directory where you want to save these directories.
Continue updating the working directory
Also within the agent.bat file, locate this line:
SET JAVA_ARGS=-Dfile.encoding=UTF-8 -Dlog4j.configurationFile=“%~dp0..\conf\log4j2.xml” -Dcom.perspectium.working.directory=“DIRECTORY_PATH” -classpath “%~dp0..\jars*”;“%~dp0..\extlib*” com.perspectium.replicator.Replicator
Replace this line with:
SET JAVA_ARGS=-Dfile.encoding=UTF-8 -Dlog4j.configurationFile=“DIRECTORY_PATH\conf\log4j2.xml” -Dcom.perspectium.working.directory=“DIRECTORY_PATH” -classpath “%~dp0..\jars*”;“%~dp0..\extlib*” com.perspectium.replicator.Replicator
where DIRECTORY_PATH is the full path for the working directory where you want to save these directories.
Update where logs will be saved (optional)
Open up the the log4j2.xml file in the conf folder of your new working directory(i.e. DIRECTORY_PATH\conf\log4j2.xml) in your preferred text editing application and locate the following line in the file:
<RollingRandomAccessFile name="FILE" fileName="../logs/perspectium.log"
filePattern="../logs/perspectium-%d{MM-dd-yyyy}-%i.log.gz">
Replace this line with:
<RollingRandomAccessFile name="FILE" fileName="DIRECTORY_PATH/logs/perspectium.log"
filePattern="DIRECTORY_PATH/logs/perspectium-%d{MM-dd-yyyy}-%i.log.gz">
where DIRECTORY_PATH is the full path for the working directory where you want to save the Agent's log files.
Procedure (Linux)
To specify working directories for the Agent in Linux, follow these steps:
Access the wrapper.conf file
Locate the wrapper.conf file within the conf directory of the directory where Agent is installed.
Update the working directory
Open the wrapper.conf file in your preferred text editing application and locate the following line in the file:
wrapper.java.additional.2=-Dlog4j.configurationFile=file:../conf/log4j2.xml
Replace this line with:
wrapper.java.additional.2=-Dlog4j.configurationFile=file:DIRECTORY_PATH/conf/log4j2.xml
Continue updating the working directory
Directly under the updated line in the previous step, add another line:
wrapper.java.additional.3=-Dcom.perspectium.working.directory=DIRECTORY_PATH
where DIRECTORY_PATH is the full path for the working directory where you want to save these folders.
Update where logs will be saved (optional)
Open up the the log4j2.xml file in the conf folder of your new working directory(i.e. DIRECTORY_PATH\conf\log4j2.xml) in your preferred text editing application and locate the following line in the file:
<RollingRandomAccessFile name="FILE" fileName="../logs/perspectium.log"
filePattern="../logs/perspectium-%d{MM-dd-yyyy}-%i.log.gz">
Replace this line with:
<RollingRandomAccessFile name="FILE" fileName="DIRECTORY_PATH/logs/perspectium.log"
filePattern="DIRECTORY_PATH/logs/perspectium-%d{MM-dd-yyyy}-%i.log.gz">
where DIRECTORY_PATH is the full path for the working directory where you want to save the Agent's log files.