Cygwin and crontab backups via ssh/scp/rsync

Install the "Editors" and "Net" groups that will give you rsync, ssh, ssh-keygen and cron.

The trickiest thing that I keep forgetting about each time is you have to run "cron-config" which adds the cron service to Windows, and without doing that obviously no cron jobs will be run thus making automatic backups impossible.

Warning about rsync/cygwin and using the -a archive switch.

It's a good thing I caught this because it doesn't work right when trying to use -a.  I noticed many directories would be created on the Linux side with permissions of 000, almost at random.  In plain English if you use the -a switch or try to preserve permissions then you are pretty much guaranteed that not all of the expected files and directories will be backed up by your rsync script.  Supposedly this is not a bug but the fact that Windows filesystem permissions do not always translate to expected/sensible results on the Linux end.  I personally believe cygwin or rsync should handle this and ensure that any directories are created with a least permissions of 700 to make sure the issue I found doesn't occur.  I can only imagine how many sorry people are out there who can't understand why their rsync backups seemed to fail or only backup some files they expected.

I got a lot of Error 13's/permission denied to write from rsync on the receiving end which was a Linux host.   I fixed it by doing a "chmod -R 755 *" on the entire directory path.  But the true fix is to not use the "-a" switch or to preserve permissions at all.

Here are the settings I use to rsync Windows files to Linux:

rsync -Phrt --ignore-errors /directory user@host:~/path

P displays the progress

h gives human readable info

r is recursive so you don't miss any subdirectories/files

t preserves the timestamp which does not cause any issues and works fine.


Tags:

cygwin, crontab, backups, via, ssh, scp, rsyncinstall, quot, editors, groups, rsync, keygen, cron, trickiest, config, adds, thus, archive, doesn, directories, linux, permissions, preserve, guaranteed, filesystem, translate, sensible, ensure, occur, receiving, chmod, directory, settings, phrt, errors, user, displays, readable, info, recursive, subdirectories, preserves, timestamp,

Latest Articles

  • How high can a Xeon CPU get?
  • bash fix PATH environment variable "command not found" solution
  • Ubuntu Linux Mint Debian Redhat Youtube Cannot Play HD or 4K videos, dropped frames or high CPU usage with Nvidia or AMD Driver
  • hostapd example configuration for high speed AC on 5GHz using WPA2
  • hostapd how to enable and use WPS to connect wireless devices like printers
  • Dell Server Workstation iDRAC Dead after Firmware Update Solution R720, R320, R730
  • Cloned VM/Server/Computer in Linux won't boot and goes to initramfs busybox Solution
  • How To Add Windows 7 8 10 11 to GRUB Boot List Dual Booting
  • How to configure OpenDKIM on Linux with Postfix and setup bind zonefile
  • Debian Ubuntu 10/11/12 Linux how to get tftpd-hpa server setup tutorial
  • efibootmgr: option requires an argument -- 'd' efibootmgr version 15 grub-install.real: error: efibootmgr failed to register the boot entry: Operation not permitted.
  • Apache Error Won't start SSL Cert Issue Solution Unable to configure verify locations for client authentication SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line SSL Library Error: 185090057 error:0B084009:x509 certif
  • Linux Debian Mint Ubuntu Bridge br0 gets random IP
  • redis requirements
  • How to kill a docker swarm
  • docker swarm silly issues
  • isc-dhcp-server dhcpd how to get longer lease
  • nvidia cannot resume from sleep Comm: nvidia-sleep.sh Tainted: Linux Ubuntu Mint Debian
  • zfs and LUKS how to recover in Linux
  • [error] (28)No space left on device: Cannot create SSLMutex Apache Solution Linux CentOS Ubuntu Debian Mint