Im trying to create a basic mysql dump cronjob in linux.
$ crontab -l
* * * * * sh /tmp/script.sh
then in cat script.sh
$ /home/mysql/bin/mysqldump dbase > /home/backup/date.sql -u root -p root
This will create and overwrite a file date.sql but now how can i get it so it has the date+timestamp as I want to do this every minute.
so i would like it to save the date-.sql rather
h
Hi All,
Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below,
1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from the file.
I have a Paas cron service that only run on minutely, hourly, daily, weekly. I want my script to run o every 15 minutes at 8am, 9am, 10am, 11am, 4pm and 5pm. how do I do that.
Hi all,
I need a script to do some date/time conversion. It should take as an input a particular time. It should then generates a series of offsets, in both hour:minute form and number of milliseconds elapsed.
For 03:00, for example, it should give back 04:02:07 (3727000ms*) 05:04:14 (7454000ms), 06:06:21 etc...
How would I go about doing this as a bash script?
I have two time strings; eg. "09:11" and "17:22" on the same day (format is hh:mm). How do I calculate the time difference in minutes between these two?
I have the following bash script lines in a file named test.sh.
Code:
#!/bin/bash
#
# Write Date to cron.log
#
echo "Begin SSI Load $(date +%d%b%y_%T)"
#
# Get the latest rates file for processing.
#
d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1)
filename=$d
export filename
echo "The file name is $filename."
When I execute ./test.sh
I'm curious if anyone has ideas what may be causing this. I have a PGP script that for whatever reason if I let linux's cron run it automatically, it sends out the final email with attachment with a blank file. If I come in and run in manually everything works fine and the file is populated in the file.
I have this simple script which redirects the output and append it to a file.
filename="/home/ronnie/tmp/hello"
date=$(date)
echo "$date" >> $filename
Now, lets suppose I change date=$(date) to date= $(date) which will generate an error.
How can I allow users to change the date and time in a script? Say the user1 wil login and he will be inputting the desired date (example format below). I will need this script so the user can login and change the date anytime during the day. I will not allow him to use any command except the date change so Im planning to incorporate a menu script on it. Pls help.