Re: [NILFS users] Utilities & Usability

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

 



Hi, John

If I understand what you wnat to do correctly,
you may be able to write a script using the lscp, mkcp and rmcp.

To create a snapshot, just invoke "mkcp -s" at an interval of "X"
minutes, as you mentioned.

To remove snapshot over the lifetime of "Y", parse the out put of lscp
and rmcp.  I don't think this is a big problem.

here are the simple bash script to display snapshot number
that is older than LIFETIME secs

--------------rmss.sh--------------
#!/bin/bash

LIFETIME=86400 # 60 * 60 * 24 sec, a day 
NOW=$(date +%s) #epoch time
TMP=/tmp/$$.ss
`lscp | grep ss |cut -b-41 > $TMP`

while read line;do
  ssno=$(echo  -n $line | cut -d' ' -f1)
  sstime=$(echo -n  $line | cut -d' ' -f2-)
  ssepoch=$(date -d"$sstime" +%s)
  t=$((ssepoch+$LIFETIME))

  if [ $NOW -gt $t ];then
    echo check point $ssno is older than $LIFETIME secs1
  fi
done <$TMP

rm -f $TMP
--------------rmss.sh--------------

I agree that higher level utility may help the daily works as you said,
however I'm not sure if it's the right way to integrate those tools low
level utils like nilfs-utils package.

Thanks

regards,
-- 
Jiro SEKIBA <jir@xxxxxxxxx>

At Tue, 5 Jan 2010 08:39:05 -0500,
John Mazza wrote:
> 
> I've been working with NILFS for a few weeks now, and find that the
> underlying filesystem is a great solution to some problems that we are
> trying to solve.  However, the userspace utilities are far too unwieldy
> to work with as a practical matter.  
> 
> The only missing piece is some way to automatically (via cleanerd maybe)
> create snapshots of the nearest checkpoint at an interval of "X"
> minutes, with a lifetime of "Y" minutes.  Currently, there is no good
> way to automate this process, and the system creates such a long list of
> checkpoints that finding a good candidate for creating a "mountable
> snapshot" to restore from is prohibitively time-consuming.  
> 
> Ideally, the behavior of the feature should create a snapshot every X
> minutes from the checkpoint closest in time to the interval, and revert
> to checkpoint status any that are older than "Y" minutes old.
> 
> Basically the goal is to keep a manageable number of snapshots to
> minimize the impact of a corrupted database file.  Since backups are
> done every 24 hours here, we would set the lifetime to 1440 minutes and
> the interval to 15 minutes, thus limiting the worst-case data loss to 15
> minutes, and with the advantage of only having to look through a list of
> 96 snapshots rather than potentially hundreds or thousands of
> checkpoints. 
> 
> It looks like all the code exists currently to do this, but it needs to
> be integrated a just a little bit more to enable this behavior. 
> 
> 
> _______________________________________________
> users mailing list
> users@xxxxxxxxx
> https://www.nilfs.org/mailman/listinfo/users
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux BTRFS]     [Linux CIFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux