File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
files/common/var/lib/delphix-platform Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ if mountpoint -q /export/home; then
3030fi
3131
3232# /export/home is not mounted, check if /home is mounted
33- # Check if /home is mounted
3433if mountpoint -q /home; then
3534 echo " /home is mounted. Proceeding with /export/home cleanup."
3635 # If /export/home exists
@@ -40,8 +39,16 @@ if mountpoint -q /home; then
4039 if [ $? -eq 0 ]; then
4140 echo " /export/home directory removed successfully."
4241 else
43- echo " /export/home is not empty. Please clean it manually before running this script."
44- exit 1
42+ # If rmdir fails, it means /export/home is not empty
43+ # Move contents to a backup location for a seamless user experience.
44+ echo " /export/home is not empty. Moving contents to /export/home.backup before cleanup..."
45+ backup_dir=" /export/home.backup.$( date +%Y%m%d_%H%M%S) "
46+ mv /export/home " $backup_dir "
47+ if [ $? -ne 0 ]; then
48+ echo " Failed to move /export/home contents to backup. Manual intervention required."
49+ exit 1
50+ fi
51+ echo " Contents of /export/home moved successfully to: $backup_dir "
4552 fi
4653 fi
4754else
You can’t perform that action at this time.
0 commit comments