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

  • 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
  • How to Install Any OS on a Physical Drive from Windows Using VMware Workstation (Linux, Windows, BSD)
  • CDN Cloudflare how to set and preserve the real IP of the client without modifying application code on Apache
  • CentOS 7 fix Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 14: curl#6 -
  • Ubuntu Debian How To Install Recommended Packages Automatically
  • How to set Linux Ubuntu Redhat Debian Command Line http https socks proxy for yum apt
  • How to resize a pdf without losing much quality in Linux Mint Ubuntu Debian Redhat Solution
  • qemu: could not load PC BIOS 'bios-256k.bin' solution
  • Proxmox How To Custom Partition During Install
  • Hyper-V Linux VM Boots to Black Screen, Storage, NIC Not Found Issues
  • Ubuntu Mint How to Fix Missing/Broken /dev and /dev/pts which causes terminal to immediately close exit and not work
  • How high can a Xeon CPU get?
  • bash fix PATH environment variable "command not found" solution