Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Backups ?
@ 2009-07-07 13:08 Marc Weber
  2009-07-07 15:26 ` wagnerdm at seas.upenn.edu
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Weber @ 2009-07-07 13:08 UTC (permalink / raw)


Hi, I'd like to setup an automatic backup system cause I don't want to
tag my mails twice and I don't want to loose the information about
archived mails etc.

What do you think about something like this?
Is it enough to keep 4 dumps?
What about moving this code into sup shutdown?
I think everyone wants to have this feature?

run_sup(){
  # untested draft
  local dump_dir="/var"
  sup
  sup-dump | bzip2 > "$dump_dir/sup-dumps-`date`"
  ls -1t "$dump_dir"/sup-dumps-* | { read; read; read; read; cat } | xargs rm
}

Marc Weber


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] Backups ?
  2009-07-07 13:08 [sup-talk] Backups ? Marc Weber
@ 2009-07-07 15:26 ` wagnerdm at seas.upenn.edu
  2009-07-07 16:10   ` Ben Walton
  2009-07-07 16:19   ` Ingmar Vanhassel
  0 siblings, 2 replies; 4+ messages in thread
From: wagnerdm at seas.upenn.edu @ 2009-07-07 15:26 UTC (permalink / raw)


Quoting Marc Weber <marco-oweber at gmx.de>:

>   ls -1t "$dump_dir"/sup-dumps-* | { read; read; read; read; cat } | xargs rm

"{ read; read; read; read; cat }" could probably better be done as  
"tail +5"; makes it easier to adjust to people's choice of backup  
count, too. ;-)
- Daniel "Bikeshedder" Wagner


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] Backups ?
  2009-07-07 15:26 ` wagnerdm at seas.upenn.edu
@ 2009-07-07 16:10   ` Ben Walton
  2009-07-07 16:19   ` Ingmar Vanhassel
  1 sibling, 0 replies; 4+ messages in thread
From: Ben Walton @ 2009-07-07 16:10 UTC (permalink / raw)


Excerpts from wagnerdm's message of Tue Jul 07 11:26:35 -0400 2009:
> >   ls -1t "$dump_dir"/sup-dumps-* | { read; read; read; read; cat } | xargs rm
> 
> "{ read; read; read; read; cat }" could probably better be done as  
> "tail +5"; makes it easier to adjust to people's choice of backup  


Or:

DAYS=5
find $dump_dir -mtime +${DAYS} -name "*sup-dumps-*" -print0 | xargs -0 --no-run-if-empty rm

(adjust xargs options to suit your environment...I don't think
--no-run-if-empty is all that portable.)

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090707/e4d9cdb7/attachment.bin>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] Backups ?
  2009-07-07 15:26 ` wagnerdm at seas.upenn.edu
  2009-07-07 16:10   ` Ben Walton
@ 2009-07-07 16:19   ` Ingmar Vanhassel
  1 sibling, 0 replies; 4+ messages in thread
From: Ingmar Vanhassel @ 2009-07-07 16:19 UTC (permalink / raw)


Excerpts from wagnerdm's message of Tue Jul 07 17:26:35 +0200 2009:
> Quoting Marc Weber <marco-oweber at gmx.de>:
> 
> >   ls -1t "$dump_dir"/sup-dumps-* | { read; read; read; read; cat } | xargs rm
> 
> "{ read; read; read; read; cat }" could probably better be done as  
> "tail +5"; makes it easier to adjust to people's choice of backup  
> count, too. ;-)
> - Daniel "Bikeshedder" Wagner

"tail -n+5", which is POSIX compatible

-- 
Exherbo KDE, X.org maintainer


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-07 16:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07 13:08 [sup-talk] Backups ? Marc Weber
2009-07-07 15:26 ` wagnerdm at seas.upenn.edu
2009-07-07 16:10   ` Ben Walton
2009-07-07 16:19   ` Ingmar Vanhassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox