I want to use rsync to backup my machines, but am not sure exactly how to do the databases. Can I just rsync the dirs with all the database info, or do I have to export the databases and rsync the resulting text/zip file? I'd have to backup MySQL and PostgreSQL. Also, how would I restore the db from the backup if I can just rsync the files instead of exporting to a text file?
Depends on the size of your database and the amount of updates and how much space you have
If you have a fairly small database, and enough space the best way would be to just dump the database info with mysqldump --opt > database$date.sql this way you can keep multiple backups (preferably you can dump from remote machine)
If your database is relatively large and you are short on space you can use rsync to copy the database folder but you have to stop the database server before starting rsync (or read lock all tables in database)