I'm new to crontab
. Usually to make a backup, without crontab
, I give this command:
cd /
sudo tar -cvpzf Ubuntu_17.04_ROOT_BackUp.tgz --exclude=/proc --exclude=/lost+found --exclude=/media --exclude=/Ubuntu_17.04_ROOT_BackUp.tgz --exclude=/mnt --exclude=/sys /
Now with crontab
:
#Open and write to my_username's `crontab` file
$ sudo crontab -e -u my_username
# m h dom mon dow command
25 13 * * * cd / && export DISPLAY=:0 && /usr/bin/tar -cvpzf Ubuntu_17.04_ROOT_BackUp.tgz --exclude=/proc --exclude=/lost+found --exclude=/media --exclude=/Ubuntu_17.04_ROOT_BackUp.tgz --exclude=/mnt --exclude=/sys /
Is this right? Would this schedule my backup?
tar
command line to backup only a small directory, so that it will be fast (within a few seconds), and then test incrontab
with modified timing, for example* * * * *
every minute) -- And when the test example works, you can set the time again to once daily or nightly and return to the complete backup in yourtar
command line./mountpoint-of-external-drive/backupfile.tgz
; 2. OK, you want to seetar
running in terminal window, and you want to write it to your graphical desktop. (I think most people let crontab jobs work in the background (with no terminal input/output.) ; 3. I meant just for testing that the crontab way to run the tar command works, you can let it do a very quick job, but never mind, it is not important, if you can wait for 15 minutes during the debugging./usr/bin/xterm -e /usr/bin/tar ...
– sudodus Sep 11 '17 at 16:47