DokuWiki saves all content to flat text files under a single directory. This design choice was what initially brought me to using the software. I want to backup and restore all content easily. The task of automating backing up the wiki also might serve as a neat project.
If I didn't have a backup utility how would I manually create a backup of this wiki?
Focus on simplicity of interface and implementation over all other concerns. Making the program fast or adding a feature must not compromise its simplicity in any way.
The ssh command allows you to easily execute one-off remote commands. It also supports streaming a local file to the remote server for execution by using bash's ability to take script input on stdin.
# One-off command. ssh firstname.lastname@example.org 'echo $USER' # Full script. The -s flag to bash causes commands # to be read and executed from stdin. In this case # stdin is the content of script.sh. ssh email@example.com 'bash -s' < script.sh
The ssh command will exit with the same exit code as the remote command or script, making it largely transparent to the caller.
import subprocess subprocess.call(['ssh', 'firstname.lastname@example.org', 'ls', '-lha'])