[qubes-users] crontab backups?

I havent played with crontab in forever, and I cant code at all, but I really wanted to try to automate my backups a wee bit.

I made a basic script (qubackup) in the ~/ dom0 directory:
/home/bob/qvm-backup --yes --verbose --compress --passphrase-file ~/PASSPHRASE_FILE.txt /run/media/bob/drobo/backups/ anon-whonix centos-7-minimal email chat work personal

and set crontab to run it every:
0 1 * * * /home/bob/qbackup

but it did not seem to work. I am able to run the script and the backup will run but when i try to do it via cron then nada?

The crond seems to be running and crontab -l shows the schedule I pasted above, Is there a reason this shouldn't work?

I am no cron-expert, but in my exoerience cron and scripts often mess.
One reason seems " pipes " in scripts that usually fail when cron'ed.
Have a look at these "|" in the script and re-code them pipe-free -- to
my opinion that would be a good starting point. cheers

Thanks!
I didnt realize that cron and scripts didnt mix, I just put one long line into cron and it has started up!
Much appreciated!

I havent played with crontab in forever, and I cant code at all, but I really wanted to try to automate my backups a wee bit.

I made a basic script (qubackup) in the ~/ dom0 directory:
/home/bob/qvm-backup --yes --verbose --compress --passphrase-file ~/PASSPHRASE_FILE.txt /run/media/bob/drobo/backups/ anon-whonix centos-7-minimal email chat work personal

and set crontab to run it every:
0 1 * * * /home/bob/qbackup

but it did not seem to work. I am able to run the script and the backup will run but when i try to do it via cron then nada?

Checked the syslog? Did you use "crontab -e" to setup the crontab?

I havent played with crontab in forever, and I cant code at all, but I
really wanted to try to automate my backups a wee bit.

I made a basic script (qubackup) in the ~/ dom0 directory:
/home/bob/qvm-backup --yes --verbose --compress --passphrase-file
~/PASSPHRASE_FILE.txt /run/media/bob/drobo/backups/ anon-whonix
centos-7-minimal email chat work personal

and set crontab to run it every:
0 1 * * * /home/bob/qbackup

but it did not seem to work. I am able to run the script and the backup
will run but when i try to do it via cron then nada?

The crond seems to be running and crontab -l shows the schedule I pasted
above, Is there a reason this shouldn't work?

I am no cron-expert, but in my exoerience cron and scripts often mess.
One reason seems " pipes " in scripts that usually fail when cron'ed.
Have a look at these "|" in the script and re-code them pipe-free -- to
my opinion that would be a good starting point. cheers

Thanks!
I didnt realize that cron and scripts didnt mix, I just put one long line into cron and it has started up!
Much appreciated!

??? Your script was executable using "she-bang" (#!/bin/my_shell)?

Thank you for the response. It actually ended up that cron did not like executing a script, I just put the exact same line from the script directly into cron.

Now I just need to understand how to setup things to delete backups older than X

Cheers

> Thank you for the response. It actually ended up that cron did not like
> executing a script, I just put the exact same line from the script
> directly into cron.cron is not anti-script as such. I experienced
problems using pipes (I guess a pipe spawns off a new thread, that does
not necessarily run under the same user)
> Now I just need to understand how to setup things to delete backups
> older than X

using "find". to find *files* "f" (in contrast with "d") older than 30
days that are called backup*.luks, it would be

   find /path -type f -iname backup\*.luks -mtime +30 -print

the word "-print" displays them.

Rem1: The first "*" must be backslashed in the find command, you don't
       want bash to expand it!

Rem2: careful with auto-delete (don't complain :slight_smile:
       you replace -print by -delete

Stumpy:

Thank you for the response. It actually ended up that cron did not like executing a script, I just put the exact same line from the script directly into cron.

You can also put (executable) scripts directly in /etc/cron.daily or .weekly and they should run without having to mess with crontab.