Blame extras/backend-cleanup.sh

Packit b2c0d9
#!/bin/sh
Packit b2c0d9
Packit b2c0d9
# This script can be used to cleanup the 'cluster/distribute' translator's 
Packit b2c0d9
# stale link files. One may choose to run this only when number of subvolumes
Packit b2c0d9
# to distribute volume gets increased (or decreased) 
Packit b2c0d9
# 
Packit b2c0d9
# This script has to be run on the servers, which are exporting the data to 
Packit b2c0d9
# GlusterFS
Packit b2c0d9
#
Packit b2c0d9
# (c) 2010 Gluster Inc <http://www.gluster.com/> 
Packit b2c0d9
Packit b2c0d9
set -e
Packit b2c0d9
Packit b2c0d9
# Change the below variable as per the setup.
Packit b2c0d9
export_directory="/export/glusterfs"
Packit b2c0d9
Packit b2c0d9
clean_dir()
Packit b2c0d9
{
Packit b2c0d9
    # Clean the 'link' files on backend
Packit b2c0d9
    find "${export_directory}" -type f -perm /01000 -exec rm -v '{}' \;
Packit b2c0d9
}
Packit b2c0d9
Packit b2c0d9
main()
Packit b2c0d9
{
Packit b2c0d9
    clean_dir ;
Packit b2c0d9
}
Packit b2c0d9
Packit b2c0d9
main "$@"