cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post
Alain_Ikula
Nickel

Bash script to backup SmartEvent R80.10 doesn't work

Hello,

We are trying to backup our smartEvent  using the procedure explained in in sk122655. When we run the commands manually, it work  but when we include them in a bash script, it doesn't work. We receive the error 'Cannot stat : No such file or directory'. I've included a screenshot of the error. I've also attached the script. Do you guys see what could be the issue ?

Thanks in advance for your help.

Regards,

Alain

0 Kudos
6 Replies
XBensemhoun
Silver

Re: Bash script to backup SmartEvent R80.10 doesn't work

Hi, I would change the script by testing each variable's value.

For example:

echo ${FOLDER1}fwlogs.tgz $FWDIR/log/*

...just before executing the

tar zcf ${FOLDER1}fwlogs.tgz $FWDIR/log/*

0 Kudos
Alain_Ikula
Nickel

Re: Bash script to backup SmartEvent R80.10 doesn't work

Hi Xavier,

Thanks again for your help. When I follow your advise and I display my variables, they  show up correctly(see below) . It seems BASH is not correctly interpretating the * sign used to say "anything". Do you agree ?

Regards,

Alain

Highlighted
XBensemhoun
Silver

Re: Bash script to backup SmartEvent R80.10 doesn't work

Referring the first article I've found: did you check "your write permission to the directory from which you are executing the command"?

0 Kudos
Alain_Ikula
Nickel

Re: Bash script to backup SmartEvent R80.10 doesn't work

Thanks Xavier again for your help. No, this doesn't seem to be the problem. It works when I run the commands manually from the exact location.

Regards,

Alain

0 Kudos

Re: Bash script to backup SmartEvent R80.10 doesn't work

I just do not really understand why you don not create a backup folder in /var/log and create all the TGZ files there?

This way you always have 1 simple place to find your backup files in the location that has the most available storage.

Regards, Maarten
0 Kudos
Alain_Ikula
Nickel

Re: Bash script to backup SmartEvent R80.10 doesn't work

Dear Maarten,

Thanks a lot for your input. I see what you mean but I thought the folder was not relevant because later in the script, the files are sent to the FTP server and then deleted.

Regards,

Alain

0 Kudos