View Single Post
  #159  
Old 24th April 2012, 01:07
riverman riverman is offline
Junior Member
 
Join Date: Nov 2005
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
Thumbs up Needed changes on Centos 6.2 64-bit

Quote:
Hi,

I have problem to restore a backup. I get:

Code:
[root@ispconfig4 web6]# ~/back-res.sh dir all 2012-04-17
date: invalid date `04/'
/root/back-res.sh: line 452: [: : integer expression expected
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6  | grep -v ^log/ | tail -n 1
2012-04/
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6  | grep -v ^log/ | tail -n 1 | cut -d "-" -f 2
04/
The ls command ends a directory with / and therefor will the date be wrong...
So I changed the lines beginning with year=, md= and day= so they are like this:
Code:
year=`ls -ct $BACKUPDIR | grep -v ^log  | tail -n 1 | cut -d "-" -f 1`
md=`ls -ct $BACKUPDIR | grep -v ^log | tail -n 1 | cut -d "-" -f 2`
day=`ls -ct $BACKUPDIR | grep -v ^log | tail -n 1 | cut -d "-" -f 3 | cut -d "." -f 1`
I also had to make sure the tmpdir= variable was pointing to a valid directory which it didn't on Centos 6.2 64-bit.

Now everything works great! I was backing up a production mail server because we needed to move to a new server.
Reply With Quote