<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I write a Python script that will backup my current CSV files in Splunk each week? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366594#M66657</link>
    <description>&lt;P&gt;do you intend to run the script on the search head, will it be triggered by cron?&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2017 11:24:26 GMT</pubDate>
    <dc:creator>FritzWittwer_ol</dc:creator>
    <dc:date>2017-08-16T11:24:26Z</dc:date>
    <item>
      <title>How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366589#M66652</link>
      <description>&lt;P&gt;I want to get a script that will run each week to back up all of my files in a CSV format each week.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 13:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366589#M66652</guid>
      <dc:creator>ksarode</dc:creator>
      <dc:date>2017-08-11T13:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366590#M66653</link>
      <description>&lt;P&gt;Hey @ksarode, did you find a solution for your problem? If not do you want to describe in more detail what you are trying to accomplish to see if someone has an answer for you?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 17:42:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366590#M66653</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-08-14T17:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366591#M66654</link>
      <description>&lt;P&gt;NO i have not received the solution for my question. actually i want a script to take weekly backups of the csv files in splunk.. let me know if you can help me in writing the script.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 10:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366591#M66654</guid>
      <dc:creator>ksarode</dc:creator>
      <dc:date>2017-08-15T10:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366592#M66655</link>
      <description>&lt;P&gt;Where did you want to back them up to?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 21:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366592#M66655</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-15T21:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366593#M66656</link>
      <description>&lt;P&gt;on the same location..&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 08:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366593#M66656</guid>
      <dc:creator>ksarode</dc:creator>
      <dc:date>2017-08-16T08:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366594#M66657</link>
      <description>&lt;P&gt;do you intend to run the script on the search head, will it be triggered by cron?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 11:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366594#M66657</guid>
      <dc:creator>FritzWittwer_ol</dc:creator>
      <dc:date>2017-08-16T11:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366595#M66658</link>
      <description>&lt;P&gt;yes.. i want to run it on search head&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 11:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366595#M66658</guid>
      <dc:creator>ksarode</dc:creator>
      <dc:date>2017-08-16T11:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366596#M66659</link>
      <description>&lt;P&gt;A very lazy solution to keep a daily copy for a week and a monthly copy for a year of the whole $SPLUNK_HOME/etc needs tow simple cron jobs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;50 23 * * * umask 0007 ; tar -czf /opt/splunk/etc-`date +"\%A"`.tgz /opt/splunk/etc &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
55 23 1 * * umask 0007 ; tar -czf /opt/splunk/etc-`date +"\%B"`.tgz /opt/splunk/etc &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Uses one GB of disk space and allows to recover from any mishaps in the etc directory. You can of course use a find to select just the csv files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tar -czf /opt/splunk/etc-`date +"\%A"`.tgz `find /opt/splunk/etc -name "*.csv"`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;No need for any (python) script at all&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 12:45:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366596#M66659</guid>
      <dc:creator>FritzWittwer_ol</dc:creator>
      <dc:date>2017-08-16T12:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a Python script that will backup my current CSV files in Splunk each week?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366597#M66660</link>
      <description>&lt;P&gt;I don't know that you need a python script to do that.  Simple bash will do it.  But, if you want to go down that route, here is some help:&lt;/P&gt;

&lt;P&gt;Example a basic python backup script:&lt;BR /&gt;
&lt;A href="https://codereview.stackexchange.com/questions/66546/backup-files-script"&gt;https://codereview.stackexchange.com/questions/66546/backup-files-script&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Example of a closer example that only copies specific files and maintains directory structure:&lt;BR /&gt;
&lt;A href="https://stackoverflow.com/questions/35155382/copying-specific-files-to-a-new-folder-while-maintaining-the-original-subdirect"&gt;https://stackoverflow.com/questions/35155382/copying-specific-files-to-a-new-folder-while-maintaining-the-original-subdirect&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and a cron formatter so that you can schedule it:&lt;BR /&gt;
&lt;A href="https://www.freeformatter.com/cron-expression-generator-quartz.html"&gt;https://www.freeformatter.com/cron-expression-generator-quartz.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I highly recommend asking these types of questions over at stackexchange or stackoverflow, as there are more people over there equipped to answer that type of a question.  Not that the Splunk community can't, but that you'll have more success over there with this type of question.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 12:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-write-a-Python-script-that-will-backup-my-current-CSV/m-p/366597#M66660</guid>
      <dc:creator>ltrand</dc:creator>
      <dc:date>2017-08-16T12:53:23Z</dc:date>
    </item>
  </channel>
</rss>

