mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
pt-summary shouldn't leave empty files; both summary tools should
die if passed a --save-samples directory that has files in it.
This commit is contained in:
@@ -133,6 +133,8 @@ setup_data_dir () {
|
||||
# Check the user's --save-data dir.
|
||||
if [ ! -d "$OPT_SAVE_DATA" ]; then
|
||||
mkdir "$OPT_SAVE_DATA" || die "Cannot mkdir $OPT_SAVE_DATA"
|
||||
elif [ "$( ls "$OPT_SAVE_DATA" )" != "0" ]; then
|
||||
die "--save-samples directory isn't empty, halting."
|
||||
fi
|
||||
touch "$OPT_SAVE_DATA/test" || die "Cannot write to $OPT_SAVE_DATA"
|
||||
rm "$OPT_SAVE_DATA/test" || die "Cannot rm $OPT_SAVE_DATA/test"
|
||||
|
Reference in New Issue
Block a user