<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Mon May 20, 2013 8:47 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Mon May 20, 2013 8:47 am</pubDate>
  <lastBuildDate>Mon May 20, 2013 8:47 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: Using tar in shell script [SOLVED]</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=108613#108613</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=51077'&gt;Craxus&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Nov 04, 2012 6:37 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      That's fixed it, thanks.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
cd /var/lib/tftpboot/&lt;br /&gt;
for configfile in `find . -type f -name running-config` ; do&amp;nbsp; tar czf &amp;quot;$&amp;#123;configfile&amp;#125;-`/bin/date +\%Y\%m\%d`.gz&amp;quot;&amp;nbsp; &amp;quot;$&amp;#123;configfile&amp;#125;&amp;quot; ; done&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=108613#108613</comments>
                                        <author>Craxus</author>
                                        <pubDate>Sun Nov 04, 2012 6:37 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=108613#108613</guid>
                                      </item>
                                      <item>
                                        <title>Re: Using tar in shell script</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=108610#108610</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Nov 04, 2012 12:30 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Or&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
find . -type f -name running-config -exec tar czf $&amp;#40;dirname &amp;#123;&amp;#125;&amp;#41;/running-config-`/bin/date +\%Y\%m\%d`.gz &amp;#123;&amp;#125; \;&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=108610#108610</comments>
                                        <author>nelz</author>
                                        <pubDate>Sun Nov 04, 2012 12:30 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=108610#108610</guid>
                                      </item>
                                      <item>
                                        <title>Re: Using tar in shell script [SOLVED]</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=108609#108609</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=2793'&gt;MartyBartfast&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Nov 04, 2012 9:22 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I would probably do something like this:&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
cd /var/lib/tftpboot/&lt;br /&gt;
for configfile in `find . -type f -name running-config` ; do&amp;nbsp; tar czf &amp;quot;$&amp;#123;configfile&amp;#125;-`/bin/date +\%Y\%m\%d`.gz&amp;quot;&amp;nbsp; &amp;quot;$&amp;#123;configfile&amp;#125;&amp;quot; ; done &lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=108609#108609</comments>
                                        <author>MartyBartfast</author>
                                        <pubDate>Sun Nov 04, 2012 9:22 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=108609#108609</guid>
                                      </item>
                                      <item>
                                        <title>Using tar in shell script [SOLVED]</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=108608#108608</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=51077'&gt;Craxus&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Nov 04, 2012 8:24 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I use my TFTP server to store the configs of various routers, switches and firewalls.  Each device has its own sub-directory beneath the TFTP root directory, and in each sub-directory is one file, named 'running-config'.  I want to run a script just before midnight each day to check whether the file has been modified on that day, and if so, make a backup copy.  I've written a small script to use 'find' and 'tar' but it puts the backup files in the location I run the script from, (i.e. the TFTP root directory), but I want each backup file in each config directory.  I know why it's doing this, but I can't figure out the correct code to get it to do what I want.  This is my script&amp;#058;&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
cd /var/lib/tftpboot/&lt;br /&gt;
find . -type f -name running-config -exec tar czf running-config-`/bin/date +\%Y\%m\%d`.gz &amp;#123;&amp;#125; \;&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
How do I make the backup file stay in the same directory as the original file?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=108608#108608</comments>
                                        <author>Craxus</author>
                                        <pubDate>Sun Nov 04, 2012 8:24 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=108608#108608</guid>
                                      </item></channel></rss>