bnosac / taskscheduleR

Schedule R scripts/processes with the Windows task scheduler.
331 stars 72 forks source link

ERROR: path[1]="": The filename, directory name, or volume label syntax is incorrect #34

Closed zachasman closed 6 years ago

zachasman commented 6 years ago

I keep getting this message every time I want to access the add-in. Any advice on how to solve it?

@jwijffels

jwijffels commented 6 years ago

Haven't encountered this before. Can you provide some more information:

What does this give you? file.path(system.file("extdata", package="taskscheduleR"), "RscriptRepository.rds")

What does this give you? It should give a path to a directory on your disk. Does that path exist? readRDS(file.path(system.file("extdata", package="taskscheduleR"), "RscriptRepository.rds"))

zachasman commented 6 years ago

@jwijffels

The first request yields:

[1] "\\\\Mac/Home/Documents/R/win-library/3.4/taskscheduleR/extdata/RscriptRepository.rds"

The second request yields:

[1] "\\\\Mac/Home/Documents/R/win-library/3.4/taskscheduleR/extdata"

When I run traceback() it yields:

Warning: Error in normalizePath: path[1]="": The filename, directory name, or volume label syntax is incorrect
Stack trace (innermost first):
    3: shiny::runApp
    2: shiny::runGadget
    1: taskscheduleR::taskschedulerAddin
Error : path[1]="": The filename, directory name, or volume label syntax is incorrect
jwijffels commented 6 years ago

Looks to me you are on a Mac, the taskscheduleR is a Windows only package. This won't work on your unix machine, I even wonder how you installed that package as it is Windows only. Use the cronR package (https://cran.r-project.org/web/packages/cronR/index.html) instead as indicated in the README of the repository.

zachasman commented 6 years ago

@jwijffels I'm using Windows Parallel. TaskScheduleR has worked before on my machine I just had to redownload it and it stopped working.

Also, I've tried the cronR package. Don't I need to be on a Windows system for that as well?

jwijffels commented 6 years ago

cronR is for unix/linux, taskscheduleR for Windows I advise you to use cronR instead of taskscheduleR I don't know what windows parallel means, but the error message indicates that the path given in "\\\\Mac/Home/Documents/R/win-library/3.4/taskscheduleR/extdata" is not a rightly formatted path. I think you need to remove this file assuming that windows parallel works to schedule things on mac (I have never used that setup) and next relaunch the addin. "\\\\Mac/Home/Documents/R/win-library/3.4/taskscheduleR/extdata/RscriptRepository.rds"

zachasman commented 6 years ago

@jwijffels

That will work on MAC?

jwijffels commented 6 years ago

Yes. Mac = unix

zachasman commented 6 years ago

@jwijffels I've been trying to get cronR to work but it never does.

Adding cronjob:
---------------

## cronR job
## id:   job_6df9452cfccaa56e90dfa3df6599ec37
## tags: 
## desc: I execute things
13 17 * * * /Library/Frameworks/R.framework/Resources/bin/Rscript '/Users/joesmith/Desktop/sendit.R'  >> '/Users/joesmith/Desktop/sendit.log' 2>&1

For example, the command above should have run at 5:13 PM EST but did not.

jwijffels commented 6 years ago

Can you redirect questions regarding cronR to the cronR github repository https://github.com/bnosac/cronR