Resolution
This document explains how to maintain HShome directory on Winbox and to clean it from orphaned/redundant folders and files. Orphaned user files are redundant files that remain after deleting H-Sphere users from database.
HShome maintenance is performed with help of hshome_cleanup.js script which also informs you of missing user home folders if they are not found.
To clean HShome from orphaned files:
- Download and unpack hshome_cleanup script.
- Run the script:
cscript hshome_cleanup.js <userslistfile> <hshome_path> <orphaned_path> [/f]Where:
cscript - script interpreter
<userslistfile> - file with hsphere users list; usernames delimeted by CRLF. Obtain it by running the following query:select login from unix_user where hostid=N; [where N is logical server ID]<hshome_path> - location of HShome
<orphaned_path> - path to the existing folder where redundant files/folders will be moved.
[/f]: with this option files won't be moved at "hshome" root.
As an example, you will run something like:
cscript hshome_cleanup.js users.txt d:\hshome d:\hsorphaned
As the result, all orphaned files will be moved to the specified directory.
Here is an example of script execution:
E:\>cscript hshome_cleanup.js users.txt e:\hshome e:\hsorphaned Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Users list file: users.txt HSHome location: e:\hshome Orphaned location: E:\hsorphaned\ Moving files... E:\hshome\1.reg... Ok Warning!!! Missing user folder(s) found: User: none User: west Orphaned folder(s) found: Moving folder "testwi1"... Ok Moving folder "testwin"... Ok Moving folder "unixtest"... Ok Moving folder "userwind"... Ok Moving folder "vmwin1"... Ok Moving folder "win0422"... Ok Moving folder "win0425"... Ok Moving folder "winmiva4"... Ok Moving folder "wintest"... Ok Moving folder "wintst01"... Ok Moving folder "wmwin1"... Ok Finished