|
Demo
Discussion
|
Forum
Config Examples
Contributions
Vulnerabilities
|
Discussion forum about ELOG |
Not logged in |
 |
|
|
Message ID: 67454
Entry time: Fri Feb 22 10:58:18 2013
In reply to: 67452
|
|
Category: |
Question |
OS: |
Linux |
ELOG Version: |
2.92 |
|
Subject: |
Re: any way to undelete entries? |
|
|
Mark Bergman wrote: |
Is there any way within eLog to undelete entries?
|
I wrote to scripts to backup the logbook files:
- elog_backup_daily creates a tar file of all new entries of the last 25 hours and keeps these backups for 90 days
- elog_backup_hourly creates a tar file of the entries of the last 65 minutes and keeks these backups for one week
- exclude-logbooks specifies which files not to backup
This allows you at least to recover deleted entries by hand as an administrator.
  ⇄
Detect language » English
 ⇄
Detect language » English
⇄
Detect language » English
|
|
#!/bin/sh
# source file directory
srcd=/usr/local/elog/
# backup all files newer than 25 hours
date=$(date -d "-25hours" "+%Y%m%d %H:%M")
# backup file directory
tard=/logbooks_backup
# backup tar file name
tarf=$tard/$(date +%Y%m%d_%a.tar)
# do not backup files that match patterns in this file
excf=/usr/local/elog/utilities/exclude-logbooks
# create backup
cd $srcd
tar --ignore-case -X $excf --newer "$date" -cf $tarf . logbooks/*
# copy passwd.txt
if [ "$(date +%u)" -eq 1 ]
then
passwd=$tard/passwd_$(date +%Y%m%d_%a.txt)
cp $srcd/passwd.txt $passwd
gzip -9 $passwd
fi
# delete all backups older than 90 days
find $tard -mtime +90 -name "*_???.tar" -exec rm -f {} +
find $tard -mtime +90 -name "passwd_*_???.txt.gz" -exec rm -f {} +
|
|
#!/bin/sh
# source file directory
srcd=/usr/local/elog/
# backup all files newer than 25 hours
date=$(date -d "-65minutes" "+%Y%m%d %H:%M")
# backup file directory
tard=/logbooks_backup
# backup tar file name
tarf=$tard/$(date +%a%H%M.tar)
rm -f $tarf
# do not backup files that match patterns in this file
excf=/usr/local/elog/utilities/exclude-logbooks
# create backup
cd $srcd
tar --ignore-case -X $excf --newer "$date" -cf $tarf . logbooks/*
|
|
*.png.png
*.gif.png
*.jpg.png
*.pdf.png
oldLogbooks/*
logbooks/elog.log
passwd.txt
ssl/*
logbooks/Backup/*
logbooks/old/*
|