Well thank you both very much! I have something that works. I can always make it better later, perhaps.
@Firerat: I don't need to back up the files really, I changed my php file to write 2 copies to 2 directories. If, after a week or a month, no students are complaining about their results, I will delete all the backups anyway. Each week I need to get rid of the old files so they don't get mixed up with new, incoming files. I'm afraid I don't understand anything about your tips for ssh/config I am just not a computer person. I would like to ask about: ssh $server:${RemotePath}/ "${Answers}" Why do I need the / and why the "" around ${Answers}?? And why do I need {}? |
Quote:
Quote:
rsync behaves differently if it ends / Code:
server:path/to/remotedir /path/on/local/incoming /path/on/local/incoming/remotedir containing the contents Code:
server:path/to/remotedir/ /path/on/local/incoming The "" , this is to prevent splitting, Answers="/path/to/dir with spaces" rsync server:path/upload ${Answers} would be seen by the shell like 'rsync server:path/upload' '/path/to/dir' 'with' 'spaces' with "" around it 'rsync server:path/upload' '/path/to/dir with spaces' {} easier if I use an example Code:
#!/bin/bash Personal I just think they look better so it is rare that I don't use them |
Thanks again, you've been a great help!
As a non-computer person, I can only get some working code from somewhere, then slowly alter 1 little thing at a time, see what happens, till I get what I want. And of course, I ask for tips, here, or on Python or PHP forums. I do that with Python. Now I have code which generates homework webpages and css files, collects and marks the homework and enters the grades in my records, all just from tiny building blocks and text files! I'm always amazed that it works! Thanks a lot! |
Quote:
Code:
echo "this is foobar ${var}bar" Code:
echo this is foobar "${var}bar" Code:
echo this is foobar "$var"bar |
echo was just a cheap way to show what {} was doing
assume the answers needed base dir Code:
username@123.123.123.123:${RemotePath}/ "${base}/${Answers}" |
All times are GMT -5. The time now is 01:23 PM. |