Hi again, everybody. My recent purchases include a Fantom GD1000EU 1 TB USB HD and a Logitech LX8 cordless mouse (on sale at Staples this week BTW), both of which worked right away under Linux (Mandriva 2008.1) without any special configuration. I haven't yet tried to get all the "other" mouse buttons recognized, but I've found web info and will look into it. That's my latest report on compatible hardware.

Anyway, now that I have the extra hard disk space, I'm working on a simple cron task to back up selected directories, since nothing available seemed to be quite what I wanted. It was straightforward, except for two lines that I can't seem to get right although I've tried lots of things. Script excerpts are below. Can anybody point me in the right direction, please? Thanks!

Also, can anyone offer any general advice on when to do incremental (instead of full) backups? Right now daily backups of the "important" stuff are about 2 GB, so it's not much trouble to do a full backup every night to the HD, and weekly to a DVD, and monthly to a DVD that gets stored offsite. This is a home system, nothing really critical.

Adam

==========

#!/bin/bash
BACKUP_DIR=/mnt/backup

TODAY=$(date +%y%m%d)
# so backup files will be named ${TODAY}.tgz, yymmdd.tgz, e.g. today's is 090202.tgz and Saturday's was 090131.tgz

# set flags: nonzero means do full monthly and weekly backups
MONTHLY=1
WEEKLY=1 [if any of ${BACKUP_DIR}, ${BACKUP_DIR}/weekly, or ${BACKUP_DIR}/monthly are not writeable directories, abort]



### problems are the next two statements

# set flag /not/ to do monthly backup if /mnt/backup/monthly contains any file that starts with current year and month
# i.e. if today there's any file called ${BACKUP_DIR}/monthly/0902*
### I can't get the next line to detect it reliably somehow
if [ -f "${BACKUP_DIR}/monthly/$(date +%y%m)*" ] ; then
   MONTHLY=0
fi

# set flag /not/ to do weekly backup if /mnt/backup/weekly contains any file with mod time less than about 5 days ago
### next line does not work, always zeros WEEKLY even if no matching files
find "${BACKUP_DIR}/weekly/*" -mtime -5 -exec test $((WEEKLY=0)) \; -quit

### the rest of the script works correctly -- thanks again for looking at it!

_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium
 Feb 4 - Ruby on Rails
 Mar 4 - TBD
 Apr 1 - TBD

Reply via email to