<?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: cron &amp;amp; tar in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148112#M31680</link>
    <description>Hi Jared&lt;BR /&gt;&lt;BR /&gt;Thanks for the feed back.  I kind of thought the script was ok too.  I didn't set this box up so there must be some funky cron setting that I am missing.  At least I can rule the script out.&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
    <pubDate>Thu, 21 Feb 2008 03:06:00 GMT</pubDate>
    <dc:creator>Paul Sperry</dc:creator>
    <dc:date>2008-02-21T03:06:00Z</dc:date>
    <item>
      <title>cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148107#M31675</link>
      <description>here is my tar script I want cron to run.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;x="/some/path/$(date +%F)_mystuff.tar"&lt;BR /&gt;/bin/tar -cvf $x /path/to/backup&lt;BR /&gt;&lt;BR /&gt;I know cron and shell are different, at&lt;BR /&gt;the command line it runs fine but in cron&lt;BR /&gt;it does nothing.  Isn't this simple script&lt;BR /&gt;cron friendly?&lt;BR /&gt;&lt;BR /&gt;TIA</description>
      <pubDate>Wed, 20 Feb 2008 21:46:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148107#M31675</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-20T21:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148108#M31676</link>
      <description>I take that back.  At the command line it says:&lt;BR /&gt;&lt;BR /&gt;/bin/tar: Removing leading `/` from member names&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But it does work and create the tar</description>
      <pubDate>Wed, 20 Feb 2008 21:55:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148108#M31676</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-20T21:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148109#M31677</link>
      <description>Ok I simplified it, took the date out of the file name and removed the leading "/" from both paths&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;x="some/path/mystuff.tar"&lt;BR /&gt;cd /&lt;BR /&gt;/bin/tar -cvf $x path/to/backup&lt;BR /&gt;&lt;BR /&gt;Now no messages at command line and it works fine.  But still does not work in cron.  I took the date thing out but I REALLY do need it&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Feb 2008 22:22:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148109#M31677</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-20T22:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148110#M31678</link>
      <description>Some more strange facts.  The cron log is not showing the CMD (/path/to/script.sh)&lt;BR /&gt;like it usually does for all my other cron jobs. It's just showing (root) RELOAD (cron/root)</description>
      <pubDate>Wed, 20 Feb 2008 22:49:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148110#M31678</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-20T22:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148111#M31679</link>
      <description>Hi Paul,&lt;BR /&gt;&lt;BR /&gt;Your initial example script works fine for me in cron (RHEL 4.6 ES, bash, vixie-cron-4.1-49.EL4).&lt;BR /&gt;&lt;BR /&gt;I got a tar file that looks as expected and an email from cron (because output was not redirected):&lt;BR /&gt;Subject: Cron &lt;MYUSERID&gt; /home/myuserid/myscript&lt;BR /&gt;&lt;BR /&gt;/bin/tar: Removing leading `/' from member names&lt;BR /&gt;/home/myuserid/testdata/&lt;BR /&gt;/home/muuserid/testdata/miscfiles&lt;BR /&gt;... etc ...&lt;BR /&gt;&lt;BR /&gt;So, I'm not sure what your specific issue is, but wanted to give some feedback so you can focus on things other than the script itself.&lt;BR /&gt;&lt;BR /&gt;Jared Middleton&lt;/MYUSERID&gt;</description>
      <pubDate>Thu, 21 Feb 2008 00:31:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148111#M31679</guid>
      <dc:creator>Jared Middleton</dc:creator>
      <dc:date>2008-02-21T00:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148112#M31680</link>
      <description>Hi Jared&lt;BR /&gt;&lt;BR /&gt;Thanks for the feed back.  I kind of thought the script was ok too.  I didn't set this box up so there must be some funky cron setting that I am missing.  At least I can rule the script out.&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Thu, 21 Feb 2008 03:06:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148112#M31680</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-21T03:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148113#M31681</link>
      <description>How is it being called from Cron?&lt;BR /&gt;&lt;BR /&gt;Is it a user-based crontab (i.e. crontab -u)?  A system-based crontab (/etc/crontab, /etc/cron.d/&lt;CRONTAB&gt;, /etc/cron.{daily,weekly,monthly}/&amp;lt;script&amp;gt;) ?&lt;BR /&gt;&lt;BR /&gt;If it's the first two, check the 'MAILTO' environment variable.&lt;BR /&gt;&lt;BR /&gt;If it's one of the last 3, then check the MAILTO variable in '/etc/crontab'.&lt;BR /&gt;&lt;BR /&gt;If it's a user-based crontab, once again, the MAILTO variable in there.&lt;/CRONTAB&gt;</description>
      <pubDate>Thu, 21 Feb 2008 03:39:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148113#M31681</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2008-02-21T03:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148114#M31682</link>
      <description>Hey guys,&lt;BR /&gt;&lt;BR /&gt;First of all thanks for your input.&lt;BR /&gt;As you can see from my profile Iam&lt;BR /&gt;a HP-UX guy not a linux guy.  &lt;BR /&gt;It turns out that my original script&lt;BR /&gt;would have worked but I was not&lt;BR /&gt;giving cron enough time to "reload".&lt;BR /&gt;That is when I was testing I would schedule&lt;BR /&gt;cron to execute the script about 2 minutes&lt;BR /&gt;after I edited the script.  After hours of&lt;BR /&gt;googeling I re-edited my script to the original&lt;BR /&gt;and scheduled cron to run it 15 minutes later.&lt;BR /&gt;And guesss what...It worked.  In HP-UX I allways&lt;BR /&gt;did a date command and then scheduled cron to execute  &lt;BR /&gt;1 or 2 minutes later and it allways worked.  But I &lt;BR /&gt;guess linux needs more time.&lt;BR /&gt;&lt;BR /&gt;Silly me for wanting to test and being impatient.&lt;BR /&gt;&lt;BR /&gt;Any comments are certinally welcome.&lt;BR /&gt;&lt;BR /&gt;PS.  I like to "bunny" all of my threads.&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Feb 2008 05:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148114#M31682</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-21T05:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148115#M31683</link>
      <description>Don't blame linux.  What distribution of linux and cron are you using?  I mentioned mine earlier.  I always set my jobs to run 2 minutes out (after checking date) just like you say you do... and I don't recall ever seeing the RELOAD message/problem.&lt;BR /&gt;&lt;BR /&gt;From what I recall, cron checks for new crontabs AFTER each one minute iteration, so you do need to schedule at least 2 minutes out from the moment your crontab is saved... unless of course your job is set to execute EVERY minute (* * * * *).&lt;BR /&gt;&lt;BR /&gt;Jared</description>
      <pubDate>Thu, 21 Feb 2008 17:19:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148115#M31683</guid>
      <dc:creator>Jared Middleton</dc:creator>
      <dc:date>2008-02-21T17:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: cron &amp; tar</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148116#M31684</link>
      <description>uname -a&lt;BR /&gt;Linux server.domain.com 2.6.9-42.0.3.EL #1 Mon Sep 25 17:14:19 EDT 2006 i686 i686 i386 GNU/Linux&lt;BR /&gt;&lt;BR /&gt;Whatever that translates to.</description>
      <pubDate>Thu, 21 Feb 2008 19:53:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-amp-tar/m-p/4148116#M31684</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2008-02-21T19:53:43Z</dc:date>
    </item>
  </channel>
</rss>

