I had the same issue – seems the script has been created on a Debian
derivative, or some other release where the –output-avail flag is in the the df
coreutil. On CentOS 6 it is not, though.
I have fixed the issue by changing the two df lines in the script to:
BACKUPS_AVAILABLE_SPACE=`df $BACKUP_DIRECTORY |awk '{print $4'} |tail -n1`
This has same effect of outputting the available space.
Br,
Jes
Fra: Torry, Andrew [mailto:[email protected]]
Sendt: 21. april 2017 11:43
Til: [email protected]
Emne: [PacketFence-users] Cannot do 6.5 database backups
Hi Folks,
I am just spinning up a new 6.5 PF server and was noticed that the script for
backing up the database is broken.
Running ‘/usr/pf/addons/database-backup-and-maintenance.sh’ gives:-
df: unrecognized option '--output=avail'
Try `df --help' for more information.
./database-backup-and-maintenance.sh: line 52: ((: > (( 132476 / 2 )) : syntax
error: operand expected (error token is "> (( 132476 / 2 )) ")
ERROR: There is not enough space in /root/backup/ to safely backup files.
Skipping the backup.
The script will never work on my server as the ‘—output’ option for DF does not
exist and line 52 in the script relies on the output
of the line:-
BACKUPS_AVAILABLE_SPACE=`df --output=avail $BACKUP_DIRECTORY | awk 'NR == 2 {
print $1 }'`
BTW I am using the ZEN OVA deployment of 6.5
Any ideas how to get this to work
Andrew
Andrew Torry
Senior Infrastructure Engineer
Tel: 01326 370760
Email: [email protected]<mailto:[email protected]>
[cid:[email protected]]
[Falmouth Exeter Plus]
[cid:[email protected]]
[Twitter]<https://twitter.com/falmouthexeter>
[Facebook]<https://www.facebook.com/falmouthexeter>
[Instagram]<https://www.instagram.com/falmouthexeterplus/>
[YouTube]<https://www.youtube.com/channel/UC5-Jq4vTOhWgYoJJDYrZHWw>
[cid:[email protected]]
[Falmouth University]
Falmouth Exeter Plus is an exempt charity established by Falmouth University
and the University of Exeter to deliver their shared Higher Education services
in Cornwall.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users