-
FTP script to automate file transfers to remote server
Below you will find a FTP script that will allow you to automate your files transfers without requiring any user input. The only problem with this method is you will be putting a username and password into the script file, but having a simple automated FTP file upload or FTP file download probably outweighs the drawback.
So to describe what this script does:
First the script will tar and zip all files and folders in the /var/log/ folder to the home directory of the user who runs the script. This will create a dated zip file in the user’s home folder who ran the script. Then it will FTP the files to the remote host. You can then add the script to a cron job to execute it everyday, week, hour, etc.
Read the rest of this entry » -
Simple Postgresql Cron Backup
Here is a very simple method to backup your postgresql DB using a cron job and the pg_dump command. The main problem people encounter when trying to automate the pg_dump command is the password input. Now you could easily create a local user with no password, but why would you want to do that.
-
Updating Server Time on Ubuntu
A handy way to help keep a Ubuntu server’s date current is to add a daily cron job that runs the ntpdate command. To do this you just repeat the following in a terminal.
Create a file named ntpdate in /etc/cron.daily/ :sudo nano /etc/cron.daily/ntpdateNow add the following to this file:
ntpdate ntp.ubuntu.com pool.ntp.orgSave and exit, then make the job executable:
sudo chmod 755 /etc/cron.daily/ntpdateYour server will now update once a day using either the ntp.ubuntu.com or pool.ntp.org time server. But there is a better way…
Read the rest of this entry » -
Simple Script to Backup Smaller MYSQL Databases remotely
Here is a simple script you can use to add as a job that you can use to backup smaller remote MYSQL DB’s. This script will take a mysql dump, date it, then add it to an archive (with the date), then the uncompressed file is deleted. It is perfect to use as a daily cronjob. The instructions are specifically for Ubuntu, but it can be easily modified for Unix or even a Windows batch file.