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

  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist