Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=vmexam.git;a=commitdiff;h=32d035d3996ae32dfefed2e33dfec9dd507e142c
commit 32d035d3996ae32dfefed2e33dfec9dd507e142c
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date: Thu Nov 22 13:57:22 2007 +0100
gammu: import
a set of scripts to make a full backup of your phone using gammu
diff --git a/gammu/backup-fs.py b/gammu/backup-fs.py
new file mode 100644
index 0000000..adcd6fa
--- /dev/null
+++ b/gammu/backup-fs.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import os, re, shutil, time
+
+bd = "filesystem-%s" % time.strftime("%Y%m%d", time.localtime())
+try:
+ shutil.rmtree(bd)
+except OSError:
+ pass
+os.mkdir(bd)
+os.chdir(bd)
+
+sock = os.popen("gammu --getfilesystem -flatall")
+
+buf = sock.readlines()
+
+sock.close()
+
+for i in buf:
+ if not re.search("File", i):
+ continue
+ id = i.split(";")[0]
+ folder = i.split(";")[2].strip('"')
+ file = i.split(";")[3]
+
+ try:
+ os.mkdir(folder)
+ except OSError:
+ pass
+
+ cwd = os.getcwd()
+ os.chdir(folder)
+ os.system("gammu --getfiles %s" % id)
+ os.chdir(cwd)
diff --git a/gammu/backup.sh b/gammu/backup.sh
new file mode 100644
index 0000000..485e1fd
--- /dev/null
+++ b/gammu/backup.sh
@@ -0,0 +1,6 @@
+date=`date +%Y%m%d`
+
+echo -e "no\nALL" |gammu --backup backup-$date.txt
+echo -e "no\nALL" |gammu --backupsms backupsms-$date.txt
+gammu --geteachsms > eachsms-$date.txt
+python backup-fs.py
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git