Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jak@swManzana:~$ ls -l /backup/tempweb.sql
- -rw-rw-r-- 1 jak jak 204874 Mar 17 23:45 /backup/tempweb.sql
- jak@swManzana:~$ date
- Thu Mar 17 23:51:01 MDT 2016
- jak@swManzana:~$ date
- Thu Mar 17 23:53:03 MDT 2016
- jak@swManzana:~$ ls -l /backup/tempweb.sql
- -rw-rw-r-- 1 jak jak 204874 Mar 17 23:45 /backup/tempweb.sql
- jak@swManzana:~$ ls -l /backup/tempweb.sql
- -rw-rw-r-- 1 jak jak 204874 Mar 17 23:45 /backup/tempweb.sql
- jak@swManzana:~$ date
- Thu Mar 17 23:54:03 MDT 2016
- jak@swManzana:~$ cat /usr/scripts/respsql2.sh
- #MYDATE=$(date +"%Y-%m-%d");
- #echo %MYDATE%;
- MYDATE=`date +"%Y_%m_%d_%H_%M_%S"`
- echo $MYDATE
- MYDATE2=$(date +%F_%T)_dbtarimas.sql;
- echo $MYDATE2
- #mysqldump --opt dbtarimas tmtarima ttarcprod ttarclote > /backup/$MYDATE2
- mysqldump --opt tempweb tcathue tdetailtemp tgrupodtemp tgrupomtemp tmastertemp ttermom > /backup/tempweb.sql
- cp /backup/tempweb.sql /home/jak/sql/_tempweb.sql
- scp /backup/tempweb.sql [email protected]:/home/jak/sql/
- echo "==========================FINALIZADO==================="
- #scp /backup/tari.sql [email protected]:/home/jak/sql/
- jak@swManzana:~$ ls -l /usr/scripts/respsql2.sh
- -rwxr-xr-x 1 root root 566 Mar 17 23:41 /usr/scripts/respsql2.sh
- jak@swManzana:~$ crontab -l
- # Edit this file to introduce tasks to be run by cron.
- #
- # Each task to run has to be defined through a single line
- # indicating with different fields when the task will be run
- # and what command to run for the task
- #
- # To define the time you can provide concrete values for
- # minute (m), hour (h), day of month (dom), month (mon),
- # and day of week (dow) or use '*' in these fields (for 'any').#
- # Notice that tasks will be started based on the cron's system
- # daemon's notion of time and timezones.
- #
- # Output of the crontab jobs (including errors) is sent through
- # email to the user the crontab file belongs to (unless redirected).
- #
- # For example, you can run a backup of all your user accounts
- # at 5 a.m every week with:
- # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
- #
- # For more information see the manual pages of crontab(5) and cron(8)
- #
- # m h dom mon dow command
- 0,8,16,24,32,40,48,56 8-20 * * 1-6 /usr/scripts/respsql.sh
- #*/8 20-8 * * * /usr/scripts/respsql2.sh > /tmp/log.txt 2>&1
- 40 8-20 * * 1-6 /usr/scripts/respsqlMedDia.sh
- */8 0-8,20-23 * * 1-7 /usr/scripts/respsql2.sh > > /tmp/log.txt 2>&1
- jak@swManzana:~$
- jak@swManzana:~$ ls -l /backup/tempweb.sql
- -rw-rw-r-- 1 jak jak 204874 Mar 17 23:45 /backup/tempweb.sql
- jak@swManzana:~$ date
- Thu Mar 17 23:56:33 MDT 2016
- jak@swManzana:~$
Add Comment
Please, Sign In to add comment