JoannaBlatt / tomato-root-architecture

0 stars 0 forks source link

create scripts to automate backend #27

Closed JoannaBlatt closed 6 months ago

JoannaBlatt commented 7 months ago

This script will take the initial user session id

start a virtual environment create root directory for individual session create directories inside the session directory

The next part will be done by the php side code: save file to session id location

another script will need to: process from that location show files

And a final script to: remove files at appropriate time

Handling paths will need to be done carefully. I'll also have to pass parameters to multiple python files, so that will need to be properly dealt with. Thinking about handling this in constants.

JoannaBlatt commented 7 months ago

I have a script that has the proper permissions and can currently take an argument and pass it to makeDir.py which now makes the appropriate directories needed. But it's named test.sh and others I tired to make I had more trouble setting the permissions right. Going to look over to try and find my notes on this.

JoannaBlatt commented 7 months ago

found the notes : when transferring files need to run: sed -i -e 's/\r$//' job.sh <-- this changes file when doing transfer to save https://stackoverflow.com/questions/14219092/bash-script-bin-bashm-bad-interpreter-no-such-file-or-directory chmod u+x job.sh <-- gives shell file permissions to execute

Got uploadFramework.php to pass randomized sessID to makeDirectories.sh which passes to makeDir.py which makes the appropriately labeled directory and subdirectories. Next will be saving the file to the appropriate subdirectory. After that I need to modify the backend to take the sessionID for accessing the directories. This will probably mean modifying the files themselves.

JoannaBlatt commented 6 months ago

I think the only thing left is to convert the cleanup scripts, but that shouldn't be too hard.

JoannaBlatt commented 6 months ago

backend seems to be fully automated now.