Development > Scripting and Bash

Cron job to automate backup????

(1/3) > >>

kpanic:
Hi,

You need to set EDITOR environment variable to some text editor.
I use nano here, you may use emacs, vi or anything really
For example:

shell >  export EDITOR=nano
shell >  crontab -e

## Insert or append a line like:
# min hour day_of_the_month   month   day_of_the_week   command
# So 5 past midnight of every Tuesday do...

5 0 * * 2  tar -cf   ~/back.tar  ~/Documents && mv ~/back.tar  /where-ever  2>&1 > /dev/null

# Save settings = CTRL+O
# exit = CTRL+X

firenice03:

--- Quote from: Wirezfree on December 15, 2015, 12:24:34 PM ---glad you sorted it... GL

--- End quote ---

Ditto  ;D 8)

Wirezfree:
glad you sorted it... GL

kjacobs:
Well fellas.....I tried a few more options from the links you provided, but still had no luck running grsync. It appears the GUI for rsync is fussy about starting from cron or scheduler.


So, I decided to grab the rsync command that grsync was sending and dropped that direct into scheduler......that seemed to work fine. Then I copied that command into my backup.sh script and ran the shell script from scheduler.....that worked fine too. I even setup rsync to send a log file of the backup, so I can see that everything went fine.


Thanks for the help......

firenice03:

--- Quote from: Wirezfree on December 14, 2015, 12:50:16 PM [email protected]
great minds, well hopefully great minds....

--- End quote ---

Yours yes... Mine - I'm getting there  8)  I'm good with "google"....

Yeah - looks like the App is trying to access the display.. This may help..??..
http://promberger.info/linux/2009/01/02/running-x-apps-like-zenity-from-crontab-solving-cannot-open-display-problem/

Navigation

[0] Message Index

[#] Next page

Go to full version