Skip to content
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

script to delete files in /tmp from different user #10

Closed
pdurbin opened this issue Jun 11, 2019 · 2 comments
Closed

script to delete files in /tmp from different user #10

pdurbin opened this issue Jun 11, 2019 · 2 comments
Assignees

Comments

@pdurbin
Copy link
Member

pdurbin commented Jun 11, 2019

Until IQSS/dataverse#5885 is fixed properly I'm wondering if I can have a script to run as a non-privileged user (e.g. "pdurbin") on https://jenkins.dataverse.org to delete files created by other users (e.g. "jenkins") in /tmp such as these:

/tmp/sitemap.xml
/tmp/sushi_sample_logs.json
/tmp/dvjsonld.json

I'm not sure how many there are, to be honest.

@pdurbin
Copy link
Member Author

pdurbin commented Jun 11, 2019

To make this a little more concrete, I think what I want is for something like sudo apitesttmpclean.sh to delete the files, as in the example below.

[pdurbin@gdcc-jenkins dataverse]$ ./apitesttmpclean.sh 
rm: remove write-protected regular file ‘/tmp/dvjsonld.json’? y
rm: cannot remove ‘/tmp/dvjsonld.json’: Operation not permitted
rm: remove write-protected regular file ‘/tmp/sitemap.xml’? y
rm: cannot remove ‘/tmp/sitemap.xml’: Operation not permitted
rm: remove write-protected regular file ‘/tmp/sushi_sample_logs.json’? y
rm: cannot remove ‘/tmp/sushi_sample_logs.json’: Operation not permitted
[pdurbin@gdcc-jenkins dataverse]$ 
[pdurbin@gdcc-jenkins dataverse]$ sudo apitesttmpclean.sh 
[sudo] password for pdurbin: 
pdurbin is not in the sudoers file.  This incident will be reported.
[pdurbin@gdcc-jenkins dataverse]$ cat apitesttmpclean.sh 
#!/bin/sh
rm /tmp/dvjsonld.json
rm /tmp/sitemap.xml
rm /tmp/sushi_sample_logs.json
[pdurbin@gdcc-jenkins dataverse]$

@donsizemore donsizemore self-assigned this Nov 8, 2019
@donsizemore
Copy link
Contributor

Jenkins is whirring away, so I've disabled this script. Closing.

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

2 participants