Skip to content

Add-in Delete Task Delets Script? #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
joepope44 opened this issue May 4, 2020 · 4 comments
Open

Add-in Delete Task Delets Script? #75

joepope44 opened this issue May 4, 2020 · 4 comments

Comments

@joepope44
Copy link

Hello, I attempted to delete a previously created task in the R-studio Add-in. I was very surprised to see that it deleted my entire script from my repo! I did not expect this behavior, as I just wanted the Scheduled Task to be deleted. In fact, I am pretty sure I have done this previously without issue.

Is there anyway to retrieve these files now? It does not appear in my Recycling Bin. I am on Windows.

I was attempting to debug a "file too long" error, even though my file and folder name did not seem too long and had no spaces. I changed the repo in the add-in, and it seemed to load all of my R.scripts into the task manager. I only wanted one script to run as a task, so I deleted two of them in the Add-in, thinking it would only delete the task, not the actual script itself. Well, I deleted two scripts when I realized what had happened. Please let me know if I can retrieve these, I cannot locate them anywhere, although Windows search mode is terrible. Thanks.

Taskscheduler 1.4, R 3.6

@jwijffels
Copy link
Collaborator

Nope, their gone.
Rstudio add-in was created by @OliverBLMS - maybe he knows more. I normally schedule by calling taskscheduler_create and taskscheduler_delete where this behaviour is not happening.

@joepope44
Copy link
Author

Yea I figured. I'm not sure what solution might help the next person. When I changed the Rscript.repo in the Add-in, it brings up every .R file in that repo. I thought these were all now "scheduled" in the task manager, which probably wouldn't even do anything, but that was not what I wanted or expected. This is my fault in that I was unclear on what a "task" was (a .R file), but permanently deleting an object should probably have a more blatant warning alert from the UI, if possible. "!!! Deleting this task will delete the .R script in this repo. Are you sure you wish to do this?" or something?

@jwijffels
Copy link
Collaborator

Yes, agree on this. The best way to make this happen is to make the change here https://github.com/bnosac/taskscheduleR/blob/master/R/taskschedulerAddin.R#L210 and add an extra 'are you sure popup' to show. Feel free to make a pull request.

@OliverBLMS
Copy link
Contributor

the meaning of the Rscript.repo is to create a temp dir to store your selected script which you would like to schedule. It's behaviour is what is should do in order to not interfere with your original script. You select the script for scheduling, it copies the file to Rscript.repo and the OS schedulers points to this file. Changing the Rscript.repo location to your current "work directory" is not what you should do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants