I have got one server in Rackspace and i’m already running a cron job evry day night to process something…(some account related operation- that will send me email every mid night). my application is in groovy on grails. now i want to take mysql database (called myfleet) backup on every mid night and put that file in Amezon S3 . how can i do that? do i need to write any java or groovy file to process that? or is it can be done from Linux box itself? i have already got account in Amezon S3 (bucket name is fleetBucket)
Share
Should be pretty straightforward:
– backup your database using mysqldump
– upload your dump file to S3 using a command line client (e.g. http://s3tools.org/s3cmd:
s3cmd put myfleet.sql.gz s3://<bucketname>/myfleet.sql.gzJust add this to your cron job (you might want to use some kind of numbering scheme for the dump files, in case you want to keep several versions).