0

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?

Zanna
  • 72,312
IDK
  • 603

1 Answers1

0

You can add this entry to root's crontab instead:

25 13  * * * /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 /

Instead of /Ubuntu_17.04_ROOT_BackUp.tgz, you can specify the directory under which you want these backups created.

Zanna
  • 72,312
Sisir
  • 1