Add a pkgclean command.
This commit is contained in:
parent
5b8880252b
commit
bc59cab0cc
@ -7,7 +7,7 @@ use crate::db::DbHandle;
|
||||
use crate::db::DbJailAction;
|
||||
|
||||
pub(crate) const ACTION_UPDATE_JAIL: &str = "update_jail";
|
||||
const ACTION_UPDATE_JAIL_INTERVAL: u64 = 604800;
|
||||
const ACTION_UPDATE_JAIL_INTERVAL: u64 = 1209600;
|
||||
|
||||
pub(crate) fn update_jail(
|
||||
db_conn: &mut DbHandle,
|
||||
@ -21,6 +21,14 @@ pub(crate) fn update_jail(
|
||||
.arg("-u")
|
||||
.status()?
|
||||
.exit_ok()?;
|
||||
Command::new("poudriere")
|
||||
.arg("pkgclean")
|
||||
.arg("-A")
|
||||
.arg("-j")
|
||||
.arg(action.jail_name.as_str())
|
||||
.arg("-y")
|
||||
.status()?
|
||||
.exit_ok()?;
|
||||
let next_run = (SystemTime::now() + Duration::from_secs(ACTION_UPDATE_JAIL_INTERVAL))
|
||||
.duration_since(SystemTime::UNIX_EPOCH)?
|
||||
.as_secs();
|
||||
|
Loading…
Reference in New Issue
Block a user