20090202

backup-sms.sh

I always have the feeling that huge sms.db will slow down SMS application startup. So I created a script to be run in Terminal and I wish I can do an application for this.

#!/bin/sh

# backup-sms.sh
#
# Created by amanyus on 2/2/09.
# Copyright 2009 __MyCompanyName__. All rights reserved.

DATE=`date +%y%m%d`
echo "${DATE}"
if test -f /var/mobile/Library/SMS/sms.db.$DATE
then echo "Today's backup already exists."; exit; fi
if ! test -f /var/mobile/Library/SMS/sms.db.$DATE
then cp -npv /var/mobile/Library/SMS/sms.db /var/mobile/Library/SMS/sms.db.$DATE; fi
ls -lrt /var/mobile/Library/SMS/
if test -f /var/mobile/Library/SMS/sms.db.$DATE
then echo "Today's backup successful"; fi

No comments:

Post a Comment