On Windows, be sure you’re using Git Bash to perform these. I’m going to say SSH keys are stored in
~/.ssh/foundations_key, but just remember yours is at
Connecting to your server
You give it your
foundations_key private key to confirm who you are, along with giving it the IP address and the username (which is always
ssh -i ~/.ssh/foundations_key email@example.com
Disconnecting from your server
If you type that when you’re on your own machine you’ll close out your terminal/command prompt.
Sending files to/from your server
scp - secure copy - to send files to your server.
scp -i ~/.ssh/foundations_key local_file.py firstname.lastname@example.org:
- If the file is in Downloads or on your Desktop, you can do something like
- If you wanted to rename your file, you could do
If you want to download a file from your server, you just change around the source and destination.
scp -i ~/.ssh/foundations_key email@example.com:remote_file.py .
. to mean “Download the file into my current directory,” but you could also tell it to download the file into, say,
scp -i ~/.ssh/foundations_key firstname.lastname@example.org:remote_file.py ~/Downloads
To open up the cron editor, run
You’re probably using
nano. I hope you’re using
nano. Use the arrow keys to move around and just type when you want to type.
Ctrl+X to start the process of exiting (then press
y and hit enter to agree to save it).
The Wikipedia page for cron is actually pretty good. Your commands will be something like
* * * * * python3 myfile.py
Except that does things every minute!
If your server says “You have new mail”
New mail means you screwed something up with your cron job. Every time your cron job creates output - whether your Python script is printing to the screen, or you’re getting an error message - it sends your server an email.
It’s basically a fake email. It’s an email from your server, to your server, and it never touches the internet.
To check this email, type
Enter to read the email. Keep hitting enter to read more emails, or type
x to edit. The email should give you the error message you’re getting.
python: command not found it’s because on the server you need to use
python3 instead of
python, because That’s The Way It Is.
To delete all of these fake emails, before you exit type
d * and hit enter.