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

Batch, Archive and Automate #1

Closed
3 tasks done
theagora opened this issue Mar 9, 2020 · 3 comments
Closed
3 tasks done

Batch, Archive and Automate #1

theagora opened this issue Mar 9, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@theagora
Copy link
Contributor

theagora commented Mar 9, 2020

  • Batch import posts and commit ~ ./.cron-feed
  • Archive 7-day past posts ~ ./.cron-feed
  • Automate ~ crontab -e
# m h  dom mon dow   command
18 0,8,12,16,20 * * * cd /path/to/local/repo && ./.cron-feed
@theagora theagora self-assigned this Mar 9, 2020
@theagora theagora added the enhancement New feature or request label Mar 9, 2020
Copy link
Contributor Author

Missing ENV variables in crontab to execute non-native commands
View in Slack

@theagora
Copy link
Contributor Author

theagora commented Mar 11, 2020

  • Automate ~ crontab + ssh-agent

$ crontab -e

# m h  dom mon dow   command
18 0,8,12,16,20 * * * cd /path/to/local/repo && ./.cron-feed

$ vim .cron-feed

#!/bin/bash
if [ -z "$SSH_AUTH_SOCK" ] ; then
  eval `ssh-agent -s`
  ./.expect
fi
source /etc/profile.d/rvm.sh
...

$ vim .expect

#!/usr/bin/expect -f
spawn ssh-add /home/{user}/.ssh/{rsa}
expect "Enter passphrase for /home/{user}/.ssh/{rsa}:"
send "{password}\n";
expect "Identity added: /home/{user}/.ssh/{rsa} (/home/{user}/.ssh/{rsa})"
interact

@theagora
Copy link
Contributor Author

Done with commit fae6ec5

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

No branches or pull requests

1 participant