I copied this from a great post: Which server do I run this on & how do I execute this script to back up configuration file. Thank u
ou can compress$SPLUNK_HOME/etc/and keep backup of compressed file. A simple shell script can do this and you can schedule it for every 24 hours using cron.
TIME=`date +%b-%d-%y` # This Command will read the date.
FILENAME=splunk-configs-backup-$TIME.tar.gz # The filename including the date.
SRCDIR=/opt/splunk/etc # Source backup folder.
DESDIR=/backup # Destination of backup file.
tar -cpzf $DESDIR/$FILENAME $SRCDIR
It depends on the reason for the backup, but for routine purposes those are enough. Of course, the Splunk configuration is stored in /opt/splunk/etc so #2 is a little redundant if it's meant to include only the Splunk configuration.
--- If this reply helps you, an upvote would be appreciated.