Hi,
I need to write a backup script which:
1. Creates daily snapshots
2. Deletes old snapshots
3. Sends snapshots to another volume
Because its long ago I used some sh I need some syntactic help
Could somebody help me with the last task.
How I compare them properly?
Best Regards,
bsus
I need to write a backup script which:
1. Creates daily snapshots
2. Deletes old snapshots
3. Sends snapshots to another volume
Because its long ago I used some sh I need some syntactic help
Code:
!# /bin/sh
PATH="storage/home/user"
DATE=`/bin/date "+%d.%m.%Y"`
`/sbin/zfs snapshot $PATH@$DATE`
INTERVAL="90d"
EXPIRED=`/bin/date -v-${INTERVAL}`
SNAPSHOTS=`zfs list -t snapshot | grep ${PATH}`
# compare the snapshot names in SNAPSHOTS with the EXPIRED name and delete them
Could somebody help me with the last task.
How I compare them properly?
Best Regards,
bsus