File: backend-cleanup.sh

package info (click to toggle)
glusterfs 3.2.7-3%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 16,884 kB
  • sloc: ansic: 195,466; sh: 9,573; python: 1,564; makefile: 587; yacc: 471; lisp: 124; lex: 69
file content (28 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# This script can be used to cleanup the 'cluster/distribute' translator's 
# stale link files. One may choose to run this only when number of subvolumes
# to distribute volume gets increased (or decreased) 
# 
# This script has to be run on the servers, which are exporting the data to 
# GlusterFS
#
# (c) 2010 Gluster Inc <http://www.gluster.com/> 

set -e

# Change the below variable as per the setup.
export_directory="/export/glusterfs"

clean_dir()
{
    # Clean the 'link' files on backend
    find "${export_directory}" -type f -perm +01000 -exec rm -v '{}' \; 
}

main()
{
    clean_dir ;
}

main "$@"