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

Restic successfully creates a repo in ~/, but not in /sdcard/ #4728

Closed
sudomain opened this issue Dec 31, 2019 · 2 comments
Closed

Restic successfully creates a repo in ~/, but not in /sdcard/ #4728

sudomain opened this issue Dec 31, 2019 · 2 comments
Labels
not-bug Issue is not a bug.

Comments

@sudomain
Copy link

sudomain commented Dec 31, 2019

Problem description

Restic fails to create a backup repo in /sdcard/, like is recommended by backup procedure described in the wiki

Steps to reproduce

  1. attempt the first step of the backup procedure using restic described in the wiki

Expected behavior

restic repo should be initialized successfully

Additional information
termux-setup-storage was already run and Termux has the storage permission. It appears that creating the repo in /sdcard/ atleast partially succeeds with setting up the appropriate directories. See transcript below.

Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://termux.org/packages/ stable main
# science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable
# game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
# unstable-repo (sources.list.d/unstable.list)
deb https://dl.bintray.com/xeffyr/unstable-packages unstable main
Updatable packages:
All packages up to date
Android version:
7.0
Kernel build information:
Linux localhost 3.18.31-perf-g606096e-dirty #1 SMP PREEMPT Tue Jan 17 18:10:20 KST 2017 armv7l Android
Device manufacturer:
LGE
Device model:
LGL84VL

Transcript:

$ restic init -r ~/testrestic
enter password for new repository:                                                      
enter password again:
created restic repository 5c6c446816 at /data/data/com.termux/files/home/testrestic

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
$ restic init -r /sdcard/termux-backups
enter password for new repository:
enter password again:
Fatal: create key in repository at /sdcard/termux-backups failed: chmod /sdcard/termux-b
ackups/keys/cbd8f3acbae0a854ee8f431ae428719eb4f2e20e77254c2212474fb30f398f34: operation 
not permitted

$ ls /sdcard/termux-backups/
data  index  keys  locks  snapshots
$ ls /sdcard/termux-backups/*
/sdcard/termux-backups/data:
00  0c  18  24  30  3c  48  54  60  6c  78  84  90  9c  a8  b4  c0  cc  d8  e4  f0  fc
01  0d  19  25  31  3d  49  55  61  6d  79  85  91  9d  a9  b5  c1  cd  d9  e5  f1  fd
02  0e  1a  26  32  3e  4a  56  62  6e  7a  86  92  9e  aa  b6  c2  ce  da  e6  f2  fe
03  0f  1b  27  33  3f  4b  57  63  6f  7b  87  93  9f  ab  b7  c3  cf  db  e7  f3  ff
04  10  1c  28  34  40  4c  58  64  70  7c  88  94  a0  ac  b8  c4  d0  dc  e8  f4
05  11  1d  29  35  41  4d  59  65  71  7d  89  95  a1  ad  b9  c5  d1  dd  e9  f5
06  12  1e  2a  36  42  4e  5a  66  72  7e  8a  96  a2  ae  ba  c6  d2  de  ea  f6
07  13  1f  2b  37  43  4f  5b  67  73  7f  8b  97  a3  af  bb  c7  d3  df  eb  f7
08  14  20  2c  38  44  50  5c  68  74  80  8c  98  a4  b0  bc  c8  d4  e0  ec  f8
09  15  21  2d  39  45  51  5d  69  75  81  8d  99  a5  b1  bd  c9  d5  e1  ed  f9
0a  16  22  2e  3a  46  52  5e  6a  76  82  8e  9a  a6  b2  be  ca  d6  e2  ee  fa
0b  17  23  2f  3b  47  53  5f  6b  77  83  8f  9b  a7  b3  bf  cb  d7  e3  ef  fb

/sdcard/termux-backups/index:

/sdcard/termux-backups/keys:
48e998d2d8c322e15d4e7c0f8897c2711647bc44b12a2210ed844a78456628f0
4c8db69697b35a3d965712b5598870d8133867d45f73e0046075e1aab3a858ed
56e80bb4964fc6da18548603a0ce5a19ca3287c5a751654171715bc10d33325d
b1718d742f22ea7c8a43a215771ff55587ae83cddff2c6717496fdb0537866cf
cbd8f3acbae0a854ee8f431ae428719eb4f2e20e77254c2212474fb30f398f34
cc4f83a37ace3da6513aaae82c08ddaa5a42448d68064c5f85f532f69a48666a

/sdcard/termux-backups/locks:

/sdcard/termux-backups/snapshots:
$
@ghost
Copy link

ghost commented Dec 31, 2019

We can just disable chmod'ing of created files. It is not necessary in Termux since it single-user only and sdcards do not support chmod anyway.


As workaround you can create repository in $HOME and then move it to appropriate place.

ghost pushed a commit that referenced this issue Jan 1, 2020
Fixes problem with creating repositories in /sdcard/.
Issue #4728.
@ghost ghost added the not-bug Issue is not a bug. label Jan 1, 2020
@ghost
Copy link

ghost commented Jan 1, 2020

Version 0.9.6-1 now ignores chmod() failure and you should be able to create repositories on /sdcard/.

My device is not affected by that issue somehow...

@ghost ghost closed this as completed Jan 1, 2020
@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
not-bug Issue is not a bug.
Projects
None yet
Development

No branches or pull requests

1 participant