Jason Harlow on 22 Sep 2009 17:55:15 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] correct way to do this in bash


Nevermind...I had a brain fart on what i was trying to do.. I doubt that's the way to go.


I'd use cronolog like David said

Something like:

process | cronolog outputFile.%m%d%y_%H%M%S --period="24 hours" &



On Tue, Sep 22, 2009 at 7:35 PM, Mag Gam <magawake@gmail.com> wrote:
oh wow, SIGUSR1 sounds very complicated.

So, there is no way to do a SIGHUP depending on these bools:
ValidDate()
EnoughSpaceInTarget()
TargetDate=`date +%Y%m%d`



On Tue, Sep 22, 2009 at 6:28 PM,  <jharlow1@gmail.com> wrote:
> Assuming you don't need to restart the process but just need to roll the file at 8,
> You could write a bash script that traps a signal, and in the trap, redirect the stdout and stderr (using exec)  to a new file (with date/time stamp) or some such
>
> Instead of restarting the process at 8am just send the signal to the script (SIGUSR1 or some such)
> ------Original Message------
> From: Mag Gam
> Sender: plug-bounces@lists.phillylinux.org
> To: Philadelphia Linux User's Group Discussion List
> ReplyTo: Philadelphia Linux User's Group Discussion List
> Sent: Sep 22, 2009 6:19 PM
> Subject: [PLUG] correct way to do this in bash
>
> Currently for my research I have a process that writes 24 hours and 5
> days a week.  Its writes to standard out and there is standard error.
> There is a lot of data, close to 300Gb a day therefore I can't lose a
> minute of outage.
>
> I am capturing daily reports and cutoff is at 8:00AM.
>
> process > /phys/data/20090922/20090922.crac.out
> 2>/phys/data/20090922/20090922.crac.err.out
>
> At 7:59AM I kill the process using cron and restart the process at
> 8:00AM everyday for 5 days using cron. I lose 1 min of simulation data
> :-(.
>
> Is there a clever way to have my process run or restart at 8:00AM
> without cron and no interruption? Or is this the preferred way?
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>
>
> Sent from my Verizon Wireless BlackBerry
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug