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

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
Employee
Employee

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/*

Information Security enthusiast, CISSP, CCSP
0 Kudos
Alain_Ikula
Contributor

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

XBensemhoun
Employee
Employee

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

Information Security enthusiast, CISSP, CCSP
0 Kudos
Alain_Ikula
Contributor

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
Maarten_Sjouw
Champion
Champion

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
Contributor

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

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events