1

I'm having this batch script which i'm trying to make to backup stuff to my external drive.

For some reason, it works just fine when I run it as administrator but not when i run it as a regular user.

I want to run it as regular user because i can't open all external drive directories on my laptop for instance, they require Administrtor rights.

This is the script:

@ECHO OFF
SET ARGS=-rltShv --delete --chmod=ugo=rwX
SET EXCLUDES=--exclude-from="/cygdrive/d/Software/Portable/Rsync/excludes.txt"
SET LOG=--log-file="/cygdrive/d/Software/Portable/Rsync/rsync.log"
SET RSYNC=rsync %ARGS% %EXCLUDES% %LOG%

%RSYNC% "/cygdrive/d/Downloads/" "/cygdrive/h/Downloads/"
%RSYNC% "/cygdrive/d/Dropbox/" "/cygdrive/h/Dropbox/"
%RSYNC% "/cygdrive/d/Photos/" "/cygdrive/h/Photos/"
%RSYNC% "/cygdrive/d/Software/" "/cygdrive/h/Software/"
%RSYNC% "/cygdrive/d/Video/" "/cygdrive/h/Video/"
%RSYNC% "/cygdrive/f/" "/cygdrive/h/Music/"
%RSYNC% "/cygdrive/e/Torrents/Finished/" "/cygdrive/h/Torrents/"

Anyone could shed some light on why this is giving me a headache?

Thanks

dzhi
  • 117
  • 1
  • 10

1 Answers1

0

Make sure that rsync is in the path for your non-admin account or use it's full path in your script.

Nifle
  • 34,203
  • 26
  • 108
  • 137