From command line to a crontab script
Dear all,
I have been using the following command rsync -rav -e ssh /home/user/Documents/Documents-Sensitive/ user@server:/home/user/Documents/ to do backups, in the terms of having a duplicate of the files somewhere else (server). I would like now to turn this 1.into a script and 2. make it running every two days at 3:00 at night. 3. with low process and io priority (I think there is nice for processes and nice for io access) Is that possible in Linux and how? Could you please help me start filling in the missing parts of the puzzle? Regards Alex |
Quote:
Quote:
That would show what you understood of those threads and besides it's easier to correct. Quote:
Quote:
Do post the commands as you think you'll use it. (Also these days there's also cgroups but let's not get into that.) |
Thanks I gave the script that I am using
rsync -rav -e ssh /home/user/Documents/Documents-Sensitive/ user@server:/home/user/Documents/ for all the rest some help is needed. I do not want ready made solutions but mostly where to look and then someone to validate if I did it correct Alex |
See 'man 5 crontab' examples and post your proposed crontab line instead.
There's 'nice' and 'renice' (as in 'renice +20 -p $$' ;-p). For I/O see 'man ionice'. Do post the commands as you think you'll use it. |
You can get help with the part of the puzzle about crontab timing values at www.CronBuddy.com
|
Hi all,
would it be able to have cron to do something like that: - Run the script two times a month (example, every second Saturday) - Two specific dates of the months like the 10th and the 20th. Regards Alex |
can you read the man page? just look for the string "every second Saturday"
|
nothing came
|
|
Code:
#!/bin/bash Your 3am cron will use it, so remember it's name and location. |
This cron simulator is now at http://www.dataphyx.com
|
Quote:
|
Quote:
minute 0-59 hour 0-23 day of month 1-31 month 1-12 (or names, see below) day of week 0-7 (0 or 7 is Sun, or use names) if you put 50 13 8-14 * 6 your_task it doesn't mean between the 8th and the 4th IF it is saturday (which is 6) It will do : each day between the 8th and the 4th AND ALSO on every saturday so what you will have to do is test the date 50 13 8-14 * * if [ `date +%u` = 6 ];then your_task;fi in this case, your_task will be launched on the 2nd saturday or the month put another line for the fourth saturday : 50 13 16-22 * * if [ `date +%u` = 6 ];then my_task;fi Fredak |
All times are GMT -5. The time now is 11:30 PM. |