problems using cron to access NTFS encrypted files on XP Pro

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problems using cron to access NTFS encrypted files on XP Pro

cyg.108

Well I think I'm figured out part of what's going on here.  It appears
that when the backup script is run by cron, it is not able to read or
write encrypted NTFS files.  Is there a workaround?

Thanks much,
Matt



-----Original Message-----
From: Matt McNeil [mailto:[hidden email]]
Sent: Saturday, October 29, 2005 11:45 AM
To: '+cyg+108+018c9e3839.cygwin#[hidden email]'
Subject: permission denied errors in script run by cron

Hi,

I'm trying to do automated backups with a cron job in cygwin and am
running into permissions issues.  (I'm using XP Pro).

When I run these commands from the shell, they work fine -- no errors:

cd /e/
/bin/cp -uvdR  My\ Documents/ /f/Documents\ and\ Settings/Matt/
/bin/echo 'done with /e/My Documents...'

However, when run from my crontab:

40 11 * * * /home/Matt/backup >> /home/Matt/backup.log 2>&1

it fails with errors like this:

`My Documents/Dev/Spectrum/spectrum notes.txt' -> `/f/Documents and
Settings/Matt/My Documents/Dev/Spectrum/spectrum notes.txt'
/bin/cp: cannot open `My Documents/Dev/Spectrum/spectrum notes.txt'
for reading: Permission denied

If I include a /bin/whomai command in the backup script hit by cron, I
get, as expected my username "Matt".

I've tried a number of permissions settings on both the source and
target directories, but none seem to help.  Right now, they are set
like this in Cygwin:

-rwxrwxrwx  1 Matt SYSTEM 3.0K Oct 29 01:17 spectrum notes.txt

These directories are also set to allow Full Control to "Everyone"
using the XP Pro Security dialog.

How can I set these permissions correctly (or get cron to run my
script with the same context as it does when it works correctly from
the command line)?

Thanks much,
Matt





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: problems using cron to access NTFS encrypted files on XP Pro

Corinna Vinschen-2
On Nov  9 23:01, [hidden email] wrote:
>
> Well I think I'm figured out part of what's going on here.  It appears
> that when the backup script is run by cron, it is not able to read or
> write encrypted NTFS files.  Is there a workaround?

Yes, use the Windows task scheduler.  You can't access the encrypted
files because the cron jobs don't run with full user credentials.  In
other words, they don't have your password, which is necessary to access
encrypted files.  There's no workaround, except by either storing your
password in cleartext or two-way encrypted at some point to do a
subsequent user logon (which should be a no-no for obvious reasons), or
by using a scheduler which is using password authentication to do its
job, which is for instance the windows scheduler.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/