Development > Scripting and Bash

Cron job to automate backup????

(1/3) > >>


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


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

--- End quote ---

Ditto  ;D 8)

glad you sorted it... GL

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 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......


--- 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..??..


[0] Message Index

[#] Next page

Go to full version