I coughed up this after a while
#array=( $line )
Now I can use your file finding snippet and I'm one step closer.
To give the bigger picture:
- Deltacopy is running on the Windows computers
- A script with root privileges is (via cron) invoked to start the backup.
The script chowns the users' backup dir to make sure that after the copy it has the correct user permissions.
Now, in the scenario where a user can invoke the backup with a PHP page where there is a 'backup now' button:
- When the user clicks on 'back up now' button, a file with the user ip will be created in the same dir as where the PHP script is.
- Root script will find out whether there are ip files and then invokes a
- user script which will make the backup (so it will call the Deltacopy server), chowns the files in the backup so the user has permission and then deletes the ip file (the root script will have set the correct permission so that the user script can delete this file).
In order for the user script to work, it needs the ip address and backup dir (which can be found in the 'users.txt' file). I want to pass these arguments in an array from the root script to the user script. That explains my use of the array.