rsync-time-backup icon indicating copy to clipboard operation
rsync-time-backup copied to clipboard

Cron friendly

Open prontog opened this issue 4 years ago • 3 comments

Hello and thanks for this very useful tool!

Regarding #181, I made a couple changes that under circumstances always wrote to STDERR. This is a problem with cron where you usually redirect STDOUT to /dev/null but want to keep STDERR as is so that you get an email notification when a warning or error occurs.

The first change was with the df check on SRC_FOLDER right after the trailling / is stripped. In the case of SRC_FOLDER == / , the / was stripped and df wrote to STDERR because FILE was the empty string.

The second change was the -o UserKnownHostsFile=/dev/null fixed ssh argument. This lead to ssh always writing to STDERR. This is part of #128. I would expect people to first setup the ssh access and then use rsync_tmbackup.sh. I cant' see a reason in bypassing the local configuration by default. There is always the -e option of rsync which can be used to set ssh options.

Best regards,

Panos

prontog avatar Nov 12 '19 12:11 prontog

Regarding #181 - I have just tested and it fails. But reason is not your fix but original #170 - df -T works different on macOS. To keep this script cross platform it should be reworked.

as per man df:

 -T      Only print out statistics for filesystems of the specified types.  More than one type may be specified in a comma separated list.  The list of
         filesystem types can be prefixed with ``no'' to specify the filesystem types for which action should not be taken.  For example, the df command:

               df -T nonfs,mfs

         lists all filesystems except those of type NFS and MFS.  The lsvfs(1) command can be used to find out the types of filesystems that are available on
         the system.

It means that as it is now does not work on macOS.

kapitainsky avatar Nov 12 '19 12:11 kapitainsky

Is it necessary to add this fix in this PR (I have no access to a Mac)?

As you say it has to do with #170. GNU df prints the fs type with -T.

prontog avatar Nov 12 '19 15:11 prontog

I think course of action is up to @laurent22 and @omer-musa-battal who created PR for #170

kapitainsky avatar Nov 12 '19 15:11 kapitainsky