Link to home
Start Free TrialLog in
Avatar of Eprs_Admin
Eprs_AdminFlag for Austria

asked on

file server scripts

Hi experts,

our linux guys use two scripts for their linux file servers.
1. When a user logs on, one script checks the SCRTACH share, if the user has already a folder, if not, the script creates one.
2. Another script deletes the content of the SCRATCH folders.

Is it possible to to do the same for a windows fileserver ?
Do you have some hints and ideas ?
Avatar of David Favor
David Favor
Flag of United States of America image

1) This is easy to understand.

2) Mention under what circumstances does this occur (scratch folders removed).
Login and logout scripts under group policies.
If you have roaming profiles, folder redirection,
Creating a shortcut on desktop pointing to %userprofile%\appdata\local\scratch
Which a login script creates. On logoff, the entire %userprofile%\appdata\local contents are dumped as these are temp space.

On Linux/UNIX is the space part of the autofs setup?
Avatar of Eprs_Admin

ASKER

Hi all,
ok I know I can use scripts for that.
Any ideas how to create the script for automatic folder creation on the SCRATCH folder ?
Just more infos.

The SCRATCH folder is a folder for users to store temporarly some files.
These files will be deleted after each week.

For that I need a script.
And I need another script.
Each user should have its own folder on the SCRATCH drive.
The script should check wether the user already has a folder on the SCRATCH drive, if not a new folder will be created.
Much depends on which scripting you are comfortable with, vbscript, powershell, batch.
Check if the folder of %isername% create when missing.
A login/logout script is straight forward logic.

The deleted each week, means end week delete all, or delete each day files from a week ago where the scratch files are available to the user for a week?
Hi Arnold,

the script should be powershell or batch.

About the deletion of files, I already have a solution.
Now I need the special script, which checks the user login and the new folder for the SCRATCH drive.
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How to use this in Windows ?

root preexec = /usr/local/scripts/mk-user-dir.sh "%u" "%g" "/folder/scratch" -m 777 -initials

Open in new window

The Linux side deals with creating the folder and then setting the permissions, 777 sets the permissions accessible to all

You can use icacls -e -t  to set permissions on the newly created folder.
Is the scratch file local to the system in the same way as the Linux, or the scratch file is on a share for Windows?