Am new to linux cron job, i am using mysql DB, my database name finaldb, i want to take this database every one hour,
I have folder called dailbackup, in this i have fol
Create somewhere a script to make your rolling backups, like this (untested, but should work):
#!/bin/bash
BKPDIR=dailbackup # You must use absolute path here
DB=finaldb
USERNAME=myusername
PASSWORD=mypassword
BKPFILE=${BKPDIR}/`date +%Y-%m-%d`/final_db_`date +%H`.sql
# Create backup
mysqldump --user=${USERNAME} --password=${PASSWORD} ${DB} | gzip -c > ${BKPFILE}
# Remove older backups (> 7 days),
# unless you want to run out of drive space
find ${BKPDIR} -mtime +7 -print0 | xargs -0 rm -rf
Then setup this script to run as an hourly cronjob:
crontab -e
0 * * * * /absolute-path-to-where-you-saved-the-script